public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/10353] Methods for deleting all file descriptors greater than given integer (closefrom)
Date: Tue, 03 Nov 2020 09:45:44 +0000	[thread overview]
Message-ID: <bug-10353-131-9KHs6fCBGm@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-10353-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=10353

--- Comment #20 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Stas Sergeev from comment #19)

> What do you think about this closefrom() to only set
> FD_CLOEXEC rather than to do the actual close()?
> Seems more consistent to me.
> - compatible with popen(), posix_spawn(), system() and co
> as you can just do it before fork()
> - does exactly what we need, and in a less invasive way -
> don't we need to close files only at exec()?

You can't set CLOEXEC safely before the fork, it would have to come after. 
There isn't much difference between closing and setting the flag directly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-11-03  9:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-10353-131@http.sourceware.org/bugzilla/>
2014-07-01  7:54 ` [Bug libc/10353] Methods for deleting all file descriptors greater than given integer fweimer at redhat dot com
2019-04-12 14:46 ` adhemerval.zanella at linaro dot org
2020-11-03  9:34 ` [Bug libc/10353] Methods for deleting all file descriptors greater than given integer (closefrom) stsp at users dot sourceforge.net
2020-11-03  9:45 ` fweimer at redhat dot com [this message]
2020-12-16 16:39 ` crrodriguez at opensuse dot org
2020-12-16 16:40 ` crrodriguez at opensuse dot org
2020-12-16 17:07 ` adhemerval.zanella at linaro dot org
2021-07-08 17:21 ` adhemerval.zanella at linaro dot org

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=bug-10353-131-9KHs6fCBGm@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).