diff --git a/src/process.c b/src/process.c index 8b587aaa4e..703352e59e 100644 --- a/src/process.c +++ b/src/process.c @@ -2155,6 +2155,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) fcntl (inchannel, F_SETFL, O_NONBLOCK); fcntl (outchannel, F_SETFL, O_NONBLOCK); +#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ) + fcntl (inchannel, F_SETPIPE_SZ, read_process_output_max); +#endif + /* Record this as an active process, with its channels. */ eassert (0 <= inchannel && inchannel < FD_SETSIZE); chan_process[inchannel] = process; @@ -8571,7 +8575,10 @@ syms_of_process (void) DEFVAR_INT ("read-process-output-max", read_process_output_max, doc: /* Maximum number of bytes to read from subprocess in a single chunk. Enlarge the value only if the subprocess generates very large (megabytes) -amounts of data in one go. */); +amounts of data in one go. + +On GNU/Linux system, the value should not exceed +`/proc/sys/fs/pipe-max-size'. See pipe(7) manpage for details. */); read_process_output_max = 4096; DEFSYM (Qinternal_default_interrupt_process,