emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a947c10d90: Use `read-process-output-max' when creating pipes on


From: Lars Ingebrigtsen
Subject: master a947c10d90: Use `read-process-output-max' when creating pipes on GNU/Linux
Date: Thu, 2 Jun 2022 05:39:34 -0400 (EDT)

branch: master
commit a947c10d9093b9f3a29b60a52bda8afa43b6fd29
Author: Frédéric Giquel <frederic.giquel@laposte.net>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Use `read-process-output-max' when creating pipes on GNU/Linux
    
    * src/process.c (syms_of_process): Note max size.
    (create_process): Set the pipe size from `read-process-output-max'
    (bug#55737).
    
    Copyright-paperwork-exempt: yes
---
 src/process.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/process.c b/src/process.c
index fe3e12343f..ccfc0bdf54 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2145,6 +2145,10 @@ create_process (Lisp_Object process, char **new_argv, 
Lisp_Object current_dir)
       inchannel = p->open_fd[READ_FROM_SUBPROCESS];
       forkout = p->open_fd[SUBPROCESS_STDOUT];
 
+#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ)
+      fcntl (inchannel, F_SETPIPE_SZ, read_process_output_max);
+#endif
+
       if (!NILP (p->stderrproc))
        {
          struct Lisp_Process *pp = XPROCESS (p->stderrproc);
@@ -8631,7 +8635,10 @@ returns non-nil.  */);
   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 systems, the value should not exceed
+/proc/sys/fs/pipe-max-size.  See pipe(7) manpage for details.  */);
   read_process_output_max = 4096;
 
   DEFVAR_INT ("process-error-pause-time", process_error_pause_time,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]