Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <emc91ce971-df60-4e97-8968-a400415c3933@d006be6d.com>
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.