summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-05-09 21:29:13 +0000
committerjilles <jilles@FreeBSD.org>2013-05-09 21:29:13 +0000
commitdcf83719521d9ab2ddf5a05929e1fefe098bf175 (patch)
tree3fab2811f6c16b96724d366c7477ad71bdce3213 /lib/libc/gen
parentb0ca453ba0893a7c4b184f1cdd1bbd29a3d5f9e6 (diff)
downloadFreeBSD-src-dcf83719521d9ab2ddf5a05929e1fefe098bf175.zip
FreeBSD-src-dcf83719521d9ab2ddf5a05929e1fefe098bf175.tar.gz
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. MFC after: 1 week
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_addopen.325
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3
index e01b497..c466578 100644
--- a/lib/libc/gen/posix_spawn_file_actions_addopen.3
+++ b/lib/libc/gen/posix_spawn_file_actions_addopen.3
@@ -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 ,
OpenPOWER on IntegriCloud