summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-17 21:16:27 +0000
committerjilles <jilles@FreeBSD.org>2011-06-17 21:16:27 +0000
commitedb18ee3379332d9615a9797e0631bad1fea8abb (patch)
tree54f4d5bf68ca7ea4193df01cbd7ae0c1d1ae39a5 /lib
parent3228f6f97d8493df02ab98237d7f416c44874d9e (diff)
downloadFreeBSD-src-edb18ee3379332d9615a9797e0631bad1fea8abb.zip
FreeBSD-src-edb18ee3379332d9615a9797e0631bad1fea8abb.tar.gz
posix_spawn(3): Document r222511 (trying to close already closed fd).
MFC after: 1 week
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/posix_spawn.323
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index 7569239..3d902bf 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 24, 2008
+.Dd June 17, 2011
.Dt POSIX_SPAWN 3
.Os
.Sh NAME
@@ -384,29 +384,28 @@ the child process exits with exit status 127).
.It
If the
.Fa file_actions
-argument is not NULL, and specifies any close, dup2, or open actions to be
+argument is not NULL, and specifies any dup2 or open actions to be
performed, and if
.Fn posix_spawn
or
.Fn posix_spawnp
fails for any of the reasons that would cause
-.Fn close ,
-.Fn dup2 ,
+.Fn dup2
or
.Fn open
to fail, an error value is returned as described by
-.Fn close ,
-.Fn dup2 ,
+.Fn dup2
and
.Fn open ,
respectively (or, if the error occurs after the calling process successfully
returns, the child process exits with exit status 127). An open file action
may, by itself, result in any of the errors described by
-.Fn close
-or
.Fn dup2 ,
in addition to those described by
.Fn open .
+This implementation ignores any errors from
+.Fn close ,
+including trying to close a descriptor that is not open.
.El
.Sh SEE ALSO
.Xr close 2 ,
@@ -443,7 +442,13 @@ The
and
.Fn posix_spawnp
functions conform to
-.St -p1003.1-2001 .
+.St -p1003.1-2001 ,
+except that they ignore all errors from
+.Fn close .
+A future update of the Standard is expected to require that these functions
+not fail because a file descriptor to be closed (via
+.Fn posix_spawn_file_actions_addclose )
+is not open.
.Sh HISTORY
The
.Fn posix_spawn
OpenPOWER on IntegriCloud