Date: Mon, 27 Jun 2022 10:38:50 +0000 From: "Laurent Bercot" <ska-dietlibc@...rnet.org> To: musl@...ts.openwall.com, "Nick Peng" <pymumu@...il.com> Subject: Re: BUG: Calling readdir/dirfd after vfork will cause deadlock. >We can't close all file handles by iterating over all file handles >number, because the maximum number of files limit is set very large, >the performance of this method is too poor. >And we can't use fork, fork will fail because of vm.overcommit_memory. >In order to optimize this, the method we used is to read the file >handes in /proc/self/fd directory and close the file handles one by >one. This may be a rare instance where close_range(2) is useful, if you don't mind being restricted to Linux (>= 5.9) and FreeBSD. https://man7.org/linux/man-pages/man2/close_range.2.html -- Laurent
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.