]> git.eshelyaron.com Git - emacs.git/commit
Manually limit file descriptors that we select on to FD_SETSIZE.
authorPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 22:43:07 +0000 (23:43 +0100)
committerPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 23:18:02 +0000 (00:18 +0100)
commit8bc85d46cc9214a531f2d2ecb3f5fb48af8105a6
tree346a7c64ac0b6a78eacdeb69b73a446d33d87266
parentf43f1e32e92ef341077b4ffdfdd743b1a6d9d284
Manually limit file descriptors that we select on to FD_SETSIZE.

This works even if another thread or process resets the resource limit
for open file descriptors, e.g., using 'prlimit' on GNU/Linux.

* src/process.c (create_process, create_pty, Fmake_pipe_process)
(Fmake_serial_process, connect_network_socket)
(server_accept_connection): Limit file descriptors to FD_SETSIZE.
* test/src/process-tests.el (process-tests--with-raised-rlimit): New
helper macro.
(process-tests--fd-setsize-test): Rename from
'process-tests--with-many-pipes'.  Increase resource limit during test
if possible.
(process-tests/fd-setsize-no-crash/make-process)
(process-tests/fd-setsize-no-crash/make-pipe-process)
(process-tests/fd-setsize-no-crash/make-network-process)
(process-tests--new-pty): Rename callers.
src/process.c
test/src/process-tests.el