This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12539] need a way to atomically set FD_CLOEXEC on fds transferred via SCM_RIGHTS


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]