public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stsp at users dot sourceforge.net" <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:34:52 +0000	[thread overview]
Message-ID: <bug-10353-131-IPu9x5cam4@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-10353-131@http.sourceware.org/bugzilla/>

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

Stas Sergeev <stsp at users dot sourceforge.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stsp at users dot sourceforge.net

--- Comment #19 from Stas Sergeev <stsp at users dot sourceforge.net> ---
Hi.

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()?
- clearly underlines the fact that O_CLOEXEC should have
been on by default since the creation of posix, but its not.
So it fixes exactly that rather than working around that by
doing explicit close().

Just an idea.

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

  parent reply	other threads:[~2020-11-03  9:34 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 ` stsp at users dot sourceforge.net [this message]
2020-11-03  9:45 ` [Bug libc/10353] Methods for deleting all file descriptors greater than given integer (closefrom) fweimer at redhat dot com
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-IPu9x5cam4@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).