mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Laurent Bercot" <>
To:, "Nick Peng" <>
Subject: Re: [musl] BUG: Calling readdir/dirfd after vfork will cause deadlock.
Date: Mon, 27 Jun 2022 10:38:50 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

>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 

  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.


  reply	other threads:[~2022-06-27 10:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25  3:40 Nick Peng
2022-06-25 12:51 ` Szabolcs Nagy
2022-06-27  4:05   ` Nick Peng
2022-06-27 10:38     ` Laurent Bercot [this message]
2022-06-27 14:21     ` Rich Felker
2022-06-27 14:29     ` Markus Wichmann
2022-06-27  7:42   ` Florian Weimer
2022-06-27  8:37     ` Szabolcs Nagy
2022-06-27  9:23       ` Florian Weimer
2022-06-27 17:33         ` Szabolcs Nagy
2022-06-25 12:56 ` Alex Xu (Hello71)
2022-06-27  7:44   ` Florian Weimer
2022-06-27 12:28     ` Alex Xu (Hello71)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).