From 6c24b8d7082222df28d2046bfe70ff0e22342f08 Mon Sep 17 00:00:00 2001 From: Matthias Dahl Date: Tue, 24 Oct 2017 15:55:53 +0200 Subject: [PATCH 1/2] Add process output read accounting This tracks the bytes read from a process's stdin which is not used anywhere yet but required for follow-up work. * src/process.c (read_process_output): Track bytes read from a process. * src/process.h (struct Lisp_Process): Add infd_num_bytes_read to track bytes read from a process. --- src/process.c | 2 ++ src/process.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/process.c b/src/process.c index fc46e74332..904ca60863 100644 --- a/src/process.c +++ b/src/process.c @@ -5900,6 +5900,8 @@ read_process_output (Lisp_Object proc, int channel) /* Now set NBYTES how many bytes we must decode. */ nbytes += carryover; + p->infd_num_bytes_read += nbytes; + odeactivate = Vdeactivate_mark; /* There's no good reason to let process filters change the current buffer, and many callers of accept-process-output, sit-for, and diff --git a/src/process.h b/src/process.h index 5a044f669f..f796719a51 100644 --- a/src/process.h +++ b/src/process.h @@ -129,6 +129,8 @@ struct Lisp_Process pid_t pid; /* Descriptor by which we read from this process. */ int infd; + /* Byte-count for process output read from `infd'. */ + unsigned long infd_num_bytes_read; /* Descriptor by which we write to this process. */ int outfd; /* Descriptors that were created for this process and that need -- 2.14.3