O_CLOEXEC / MSG_CMSG_CLOEXEC documentation

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <drepper@...>
Cc: lkml <linux-kernel@...>
Date: Wednesday, September 5, 2007 - 3:02 pm

Ulrich,

For man-pages-2.66, I have added the following documentation in
the open.2 man page for the new-in-2.6.23 O_CLOEXEC.

    O_CLOEXEC (Since Linux 2.6.23)
          Enable   the  close-on-exec  flag  for  the  new  file
          descriptor.  This is useful in multithreaded  programs
          since  using  a separate fcntl(2) F_SETFD operation to
          set the FD_CLOEXEC flag does not suffice to avoid race
          conditions  in multithreaded programs where one thread
          opens a file descriptor at the same  time  as  another
          thread does a fork(2) plus execve(2).

For the recv.2 I added the analogous:

    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).

Please let me know if these changes are correct and complete.

Cheers,

Michael

akpm@linux-foundation.org wrote:
[...]

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7

Want to help with man page maintenance?  Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages/
read the HOWTOHELP file and grep the source files for 'FIXME'.


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
O_CLOEXEC / MSG_CMSG_CLOEXEC documentation, Michael Kerrisk, (Wed Sep 5, 3:02 pm)
Re: O_CLOEXEC / MSG_CMSG_CLOEXEC documentation, Ulrich Drepper, (Thu Sep 6, 7:34 am)
Re: O_CLOEXEC / MSG_CMSG_CLOEXEC documentation, Michael Kerrisk, (Thu Sep 6, 9:38 am)