This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12539] need a way to atomically set FD_CLOEXEC on fds transferred via SCM_RIGHTS
- From: "bonzini at gnu dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 4 Mar 2011 16:16:57 +0000
- Subject: [Bug libc/12539] need a way to atomically set FD_CLOEXEC on fds transferred via SCM_RIGHTS
- Auto-submitted: auto-generated
- References: <bug-12539-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12539
Paolo Bonzini <bonzini at gnu dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |bonzini at gnu dot org
Resolution| |INVALID
--- Comment #1 from Paolo Bonzini <bonzini at gnu dot org> 2011-03-04 16:16:43 UTC ---
This is already present, but the choice of whether to close-on-exec is done by
the receiver, not the sender:
MSG_CMSG_CLOEXEC (recvmsg() only; since Linux 2.6.23)
Set the close-on-exec flag for the file descriptor received via a
Unix
domain file descriptor using the SCM_RIGHTS operation (described in
unix(7)). This flag is useful for the same reasons as the O_CLOEXEC
flag of open(2).
/* Bits in the FLAGS argument to `send', `recv', et al. */
enum
{
MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
descriptor received through
SCM_RIGHTS. */
#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
};
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.