summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2012-04-11 09:38:45 +0000
committerespie <espie@openbsd.org>2012-04-11 09:38:45 +0000
commitf6a74c88efa112ca63a63cdd919e0c4488a94d17 (patch)
tree72d34510d772bfd4340536eed833970180f7c475
parentfix install to cope with 0-sized mmap now returning EINVAL. (diff)
downloadwireguard-openbsd-f6a74c88efa112ca63a63cdd919e0c4488a94d17.tar.xz
wireguard-openbsd-f6a74c88efa112ca63a63cdd919e0c4488a94d17.zip
fuss with details
-rw-r--r--lib/libc/gen/posix_spawn.313
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_addopen.311
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_init.37
-rw-r--r--lib/libc/gen/posix_spawnattr_getflags.321
-rw-r--r--lib/libc/gen/posix_spawnattr_getpgroup.37
-rw-r--r--lib/libc/gen/posix_spawnattr_init.38
6 files changed, 36 insertions, 31 deletions
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index fe3c8fbc046..38843f411b7 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: posix_spawn.3,v 1.3 2012/04/11 08:11:30 espie Exp $
+.\" $OpenBSD: posix_spawn.3,v 1.4 2012/04/11 09:38:45 espie Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -88,13 +88,7 @@ is NULL, default values are used: caught signals in the parent
process are set to the default value in the child process, and ignored signals
stay ignored.
.Pp
-See
-.Xr posix_spawnattr_init 3 ,
.Xr posix_spawnattr_setflags 3 ,
-.Xr posix_spawnattr_setpgroup 3 ,
-.Xr posix_spawnattr_setschedparam 3 ,
-.Xr posix_spawnattr_setsigdefault 3 ,
-.Xr posix_spawnattr_setsigmask 3
for attribute details.
.Sh RETURN VALUES
Upon succesful completion, both functions return 0.
@@ -107,7 +101,7 @@ gets set to the pid of the newly created child process.
In case of an error, both functions may return
.Fn fork
or
-.Nm exec
+.Fn exec
return values and set
.Ev errno
accordingly.
@@ -121,7 +115,8 @@ with exit status 127.
.Xr fork 2 ,
.Xr posix_spawn_file_actions_init 3 ,
.Xr posix_spawn_file_actions_addclose 3 ,
-.Xr posix_spawnattr_init 3 .
+.Xr posix_spawnattr_init 3 ,
+.Xr posix_spawnattr_setflags 3
.Sh STANDARDS
Both functions conform to
.St -p1003.1-2001 .
diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3
index 0195bf2f912..a23e2e30e52 100644
--- a/lib/libc/gen/posix_spawn_file_actions_addopen.3
+++ b/lib/libc/gen/posix_spawn_file_actions_addopen.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: posix_spawn_file_actions_addopen.3,v 1.3 2012/04/11 08:11:30 espie Exp $
+.\" $OpenBSD: posix_spawn_file_actions_addopen.3,v 1.4 2012/04/11 09:38:45 espie Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -31,10 +31,10 @@
.Ft int
.Fn posix_spawn_file_actions_addopen "posix_spawn_file_actions_t *file_actions" "int fildes" "const char *restrict path" "int oflag" "mode_t mode"
.Sh DESCRIPTION
-These function add an action to
-.Xr close 2 ,
+These function add an action to
+.Xr close 2 ,
.Xr dup2 2 ,
-or
+or
.Xr open 2
a file descriptor
to a
@@ -64,7 +64,7 @@ to be called.
.It
The
.Fn posix_spawn_file_actions_addopen
-adds an action that causes
+adds an action that causes
.Bd -literal -offset indent
open(path, oflag, mode);
.Ed
@@ -83,6 +83,7 @@ Note that
makes a copy of the
.Fa path
argument.
+.El
.Sh RETURN VALUES
Upon successful completion, these functions return zero.
Otherwise they may return
diff --git a/lib/libc/gen/posix_spawn_file_actions_init.3 b/lib/libc/gen/posix_spawn_file_actions_init.3
index a750fe37cab..7897f642e19 100644
--- a/lib/libc/gen/posix_spawn_file_actions_init.3
+++ b/lib/libc/gen/posix_spawn_file_actions_init.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: posix_spawn_file_actions_init.3,v 1.3 2012/04/11 08:11:30 espie Exp $
+.\" $OpenBSD: posix_spawn_file_actions_init.3,v 1.4 2012/04/11 09:38:45 espie Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -31,7 +31,7 @@
File actions objects can be initialized by
.Fn posix_spawn_file_actions_init
and destroyed by
-.Fn posix_spawn_file_actions_destroy.
+.Fn posix_spawn_file_actions_destroy .
.Pp
Multiple initialization of the same object is undefined behavior
and will lead to memory leaks.
@@ -51,8 +51,7 @@ when running out of memory.
.Xr posix_spawn 3 ,
.Xr posix_spawn_file_actions_addclose 3 ,
.Xr posix_spawn_file_actions_adddup2 3 ,
-.Xr posix_spawn_file_actions_addopen 3 ,
-.Xr posix_spawnp 3
+.Xr posix_spawn_file_actions_addopen 3 .
.Sh STANDARDS
Both functions conform to
.St -p1003.1-2001 .
diff --git a/lib/libc/gen/posix_spawnattr_getflags.3 b/lib/libc/gen/posix_spawnattr_getflags.3
index 15fe245b8f6..db5c46a92a1 100644
--- a/lib/libc/gen/posix_spawnattr_getflags.3
+++ b/lib/libc/gen/posix_spawnattr_getflags.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: posix_spawnattr_getflags.3,v 1.3 2012/04/11 08:11:30 espie Exp $
+.\" $OpenBSD: posix_spawnattr_getflags.3,v 1.4 2012/04/11 09:38:45 espie Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -33,20 +33,25 @@ The
and
.Fn posix_spawnattr_setflags
functions are used to get or set the flags part of a
-posix_spawn attribute object referenced by
+.Xr posix_spawn 3
+attribute object referenced by
.Fa attr .
.Pp
Flag values are OR-ed from the following flags:
.Bl -tag -width POSIX_SPAWN
.It Dv POSIX_SPAWN_RESETIDS
-Reset the effective user and group ID of the spawned process to the parent's
-real user and group ID.
+Reset the effective user and group ID of the child process to the parent's
+real user and group ID,
+see
+.Xr setegid 3
+and
+.Xr seteuid 3 .
.Pp
-If the new process is created from a setuid or setgid file, usual
+If the new process is created from a set-user-ID or set-group-ID file, usual
.Xr execve 2
semantics take precedence.
.It Dv POSIX_SPAWN_SETPGROUP
-Set process group of the spawned process according to the pgroup attribute
+Set the process group of the child process according to the pgroup attribute
of the object, see
.Xr posix_spawnattr_getpgroup 3
and
@@ -58,7 +63,9 @@ to their default value in the child process.
.It Dv POSIX_SPAWN_SETSIGMASK
Set the signal mask of the child process according
to the value set by
-.Xr posix_spawnattr_setsigmask 3 .
+.Xr posix_spawnattr_setsigmask 3 ,
+using
+.Xr sigprocmask 3 .
.It Dv POSIX_SPAWN_SETSCHEDPARAM
Set the scheduling parameter of the child process
according to the value set by
diff --git a/lib/libc/gen/posix_spawnattr_getpgroup.3 b/lib/libc/gen/posix_spawnattr_getpgroup.3
index 6498f2c96c2..8082e2a8fd3 100644
--- a/lib/libc/gen/posix_spawnattr_getpgroup.3
+++ b/lib/libc/gen/posix_spawnattr_getpgroup.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: posix_spawnattr_getpgroup.3,v 1.3 2012/04/11 08:11:30 espie Exp $
+.\" $OpenBSD: posix_spawnattr_getpgroup.3,v 1.4 2012/04/11 09:38:45 espie Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -73,10 +73,9 @@ Those functions return 0.
.Xr posix_spawn 3 ,
.Xr posix_spawnattr_destroy 3 ,
.Xr posix_spawnattr_init 3 ,
-.Xr posix_spawnp 3
+.Xr sigsetops 3
.Sh STANDARDS
-Those functions
-functions conform to
+These functions conform to
.St -p1003.1-2001 .
.Sh AUTHORS
.An Ed Schouten Aq ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_init.3 b/lib/libc/gen/posix_spawnattr_init.3
index 7751c38a512..fcf18b60dae 100644
--- a/lib/libc/gen/posix_spawnattr_init.3
+++ b/lib/libc/gen/posix_spawnattr_init.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: posix_spawnattr_init.3,v 1.3 2012/04/11 08:11:30 espie Exp $
+.\" $OpenBSD: posix_spawnattr_init.3,v 1.4 2012/04/11 09:38:45 espie Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -28,7 +28,8 @@
.Ft int
.Fn posix_spawnattr_destroy "posix_spawnattr_t *attr"
.Sh DESCRIPTION
-posix_spawn attributes objects can be initialized by
+.Xr posix_spawn 3
+attributes objects can be initialized by
.Fn posix_spawnattr_init
and destroyed by
.Fn posix_spawnattr_destroy.
@@ -55,6 +56,9 @@ will be passed across a spawn operation as implemented by
or
.Fn posix_spawnp .
.Pp
+Attribute details are described in
+.Xr posix_spawnattr_setflags 3 .
+.Pp
Modifying or destroying attributes object
will not affect processes that have already been spawned.
.Sh RETURN VALUES