This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: dup3/O_CLOEXEC/F_DUPFD_CLOEXEC
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 13 Jan 2010 16:49:28 -0500
- Subject: Re: dup3/O_CLOEXEC/F_DUPFD_CLOEXEC
- References: <20100113212537.GB14511@calimero.vinschen.de>
- Reply-to: cygwin-patches at cygwin dot com
On Wed, Jan 13, 2010 at 10:25:37PM +0100, Corinna Vinschen wrote:
>Hi,
>
>the below patch implements the Linux dup3/O_CLOEXEC/F_DUPFD_CLOEXEC
>extension. I hope I didn't miss anything important since it affects
>quite a few fhandlers. Fortunately most is mechanical change, except
>for a few places (dtable.cc, pipe.cc, fhandeler_fifo.cc, syscalls.cc).
>Nevertheless, I'd be glad if somebody could have a second look into
>this.
>
>Eric, you asked for it in the first place, do you have a fine testcase
>for this functionality?
The number of times that you typed:
sa_buf = close_on_exec ()
? sec_user_nih ((PSECURITY_ATTRIBUTES) char_sa_buf, cygheap->user.sid())
: sec_user ((PSECURITY_ATTRIBUTES) char_sa_buf, cygheap->user.sid());
implies that this should be a macro or a function.
Could the setting of close_on_exec be handled in the syscalls.cc open()
so that it doesn't have to be done so many times? You could have
build_fh_name set the noexec flag so that close_on_exec() would still
work in the fhandler_*::open functions.
cgf