bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#66288: 29.1; Performance regression using pipe for subprocess


From: Paul Eggert
Subject: bug#66288: 29.1; Performance regression using pipe for subprocess
Date: Wed, 4 Oct 2023 15:49:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 10/3/23 23:52, Eli Zaretskii wrote:


+#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ)

A small point: no need to check whether GNU_LINUX is defined; any system having these two Linux macros should be Linux-compatible.

+      /* If they requested larger reads than the default system pipe
+         capacity, enlarge the capacity to match the request.  */
+      if (read_process_output_max > fcntl (inchannel, F_GETPIPE_SZ))
+       {
+         int readmax = clip_to_bounds (1, read_process_output_max. INT_MAX);

"." -> "," of course.

+         fcntl (inchannel, F_SETPIPE_SZ, readmax);

This call can fail if you aren't root and you exceed the system limit in /proc/sys/fs/pipe-max-size. So I suggest that if this fnctl fails with EPERM, trying it again after clipping to that limit.






reply via email to

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