[Midnightbsd-cvs] src [9397] trunk/lib/libc/gen/posix_spawn_file_actions_addopen.3: posix_spawn_file_actions_adddup2(3): Document difference with

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Mar 4 16:28:54 EST 2017


Revision: 9397
          http://svnweb.midnightbsd.org/src/?rev=9397
Author:   laffer1
Date:     2017-03-04 16:28:54 -0500 (Sat, 04 Mar 2017)
Log Message:
-----------
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 Paths:
--------------
    trunk/lib/libc/gen/posix_spawn_file_actions_addopen.3

Modified: trunk/lib/libc/gen/posix_spawn_file_actions_addopen.3
===================================================================
--- trunk/lib/libc/gen/posix_spawn_file_actions_addopen.3	2017-03-04 21:28:26 UTC (rev 9396)
+++ trunk/lib/libc/gen/posix_spawn_file_actions_addopen.3	2017-03-04 21:28:54 UTC (rev 9397)
@@ -123,7 +123,19 @@
 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 @@
 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 ,



More information about the Midnightbsd-cvs mailing list