Date: Thu, 16 May 2013 20:35:53 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250716 - stable/9/lib/libc/gen Message-ID: <201305162035.r4GKZrJv003390@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Thu May 16 20:35:53 2013 New Revision: 250716 URL: http://svnweb.freebsd.org/changeset/base/250716 Log: MFC 250421: posix_spawn_file_actions_adddup2(3): Document difference with dup2(). The ability to clear a file descriptor's close-on-exec flag via posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue #411. Modified: stable/9/lib/libc/gen/posix_spawn_file_actions_addopen.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/posix_spawn_file_actions_addopen.3 ============================================================================== --- stable/9/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 16 20:34:21 2013 (r250715) +++ stable/9/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 16 20:35:53 2013 (r250716) @@ -123,7 +123,19 @@ to be duplicated as dup2(fildes, newfildes) .Ed .Pp -had been called) when a new process is spawned using this file actions object. +had been called) when a new process is spawned using this file actions object, +except that the +.Dv FD_CLOEXEC +flag for +.Fa newfildes +is cleared even if +.Fa fildes +is equal to +.Fa newfildes . +The difference from +.Fn dup2 +is useful for passing a particular file descriptor +to a particular child process. .Pp The .Fn posix_spawn_file_actions_addclose @@ -169,7 +181,16 @@ The and .Fn posix_spawn_file_actions_addclose functions conform to -.St -p1003.1-2001 . +.St -p1003.1-2001 , +with the exception of the behavior of +.Fn posix_spawn_file_actions_adddup2 +if +.Fa fildes +is equal to +.Fa newfildes +(clearing +.Dv FD_CLOEXEC ) . +A future update of the Standard is expected to require this behavior, .Sh HISTORY The .Fn posix_spawn_file_actions_addopen ,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305162035.r4GKZrJv003390>