public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crrodriguez at opensuse dot org" <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: Wed, 16 Dec 2020 16:40:48 +0000 [thread overview]
Message-ID: <bug-10353-131-UY8pSJngym@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 #22 from Cristian Rodríguez <crrodriguez at opensuse dot org> ---
(In reply to Stas Sergeev from comment #19)
> 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.
What you request is now implemented with close_range(2) flag
CLOSE_RANGE_CLOEXEC
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2020-12-16 16:40 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
2020-12-16 16:39 ` crrodriguez at opensuse dot org
2020-12-16 16:40 ` crrodriguez at opensuse dot org [this message]
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-UY8pSJngym@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).