Subject: Re: bug#40023: 26.3 Emacs crashes when creating process if many file handles are in use (e.g., when using ccls)

From: Michael Albinus <[email-masked]>
Date: Sun, 12 Apr 2020 12:19:44 +0200

Mattias Engdegård <[email-masked]> writes:

> Actually reducing RLIMIT_NOFILE doesn't sound like a terrific idea --
> if anything, we need as many descriptors as we can get, in particular
> on macOS where kqueue uses up one per monitored file. If we are
> limited by FD_SETSIZE, then we shouldn't use select. Or am I missing
> something?

kqueue limits itself to (RLIMIT_NOFILE - 50) file descriptors. If 50
file descriptors aren't sufficient, we could increase that number, or
make it a defvar changeable via Lisp.

See line 397 of kqueue.c

Best regards, Michael.