summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorjmc <jmc@openbsd.org>2012-04-11 14:32:38 +0000
committerjmc <jmc@openbsd.org>2012-04-11 14:32:38 +0000
commit5f477bae47c053c15210423d895b80b44875aba3 (patch)
treea1357b9f70ad9ee0124c925c8360f38044333e14 /lib/libc
parentMove size == 0 check to the beginnig of copy(); ok espie@ (diff)
downloadwireguard-openbsd-5f477bae47c053c15210423d895b80b44875aba3.tar.xz
wireguard-openbsd-5f477bae47c053c15210423d895b80b44875aba3.zip
tweak previous;
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/posix_spawn.322
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_addopen.319
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_init.38
-rw-r--r--lib/libc/gen/posix_spawnattr_getflags.319
-rw-r--r--lib/libc/gen/posix_spawnattr_getpgroup.33
-rw-r--r--lib/libc/gen/posix_spawnattr_init.39
6 files changed, 36 insertions, 44 deletions
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index 38843f411b7..ee5361b31d5 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.4 2012/04/11 09:38:45 espie Exp $
+.\" $OpenBSD: posix_spawn.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -37,13 +37,13 @@ The
.Fn posix_spawnp
function is similar, except it constructs the pathname from
.Fa file
-following usual
+following the usual
.Ev PATH
handling rules:
if file contains a slash, then it is directly used as a path.
Otherwise,
.Fn posix_spawnp
-search every directory mentioned in
+searches every directory mentioned in
.Ev PATH
until it finds an executable.
If
@@ -51,7 +51,7 @@ If
is not set, the default is
.Dq /usr/bin:/bin .
.Pp
-Arguments to the new process are passed to
+Arguments to the new process are passed to
.Xr execve 2
as
.Fa argv
@@ -75,11 +75,12 @@ are altered according to
.Xr posix_spawn_file_actions_init 3 ,
.Xr posix_spawn_file_actions_addclose 3 ,
.Xr posix_spawn_file_actions_adddup2 3 ,
+and
.Xr posix_spawn_file_actions_addopen 3 .
.Pp
The
.Fa attrp
-argument can be used to control signal, uid and gid handling in the
+argument can be used to control signal, UID and GID handling in the
child process.
.Pp
If
@@ -88,15 +89,16 @@ 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
-.Xr posix_spawnattr_setflags 3 ,
+See
+.Xr posix_spawnattr_setflags 3
for attribute details.
.Sh RETURN VALUES
-Upon succesful completion, both functions return 0.
+Upon successful completion, both functions return 0.
If
.Fa pidp
-is not a NULL pointer,
+is not a NULL pointer,
.Li *pidp
-gets set to the pid of the newly created child process.
+gets set to the PID of the newly created child process.
.Pp
In case of an error, both functions may return
.Fn fork
@@ -113,8 +115,8 @@ with exit status 127.
.Sh SEE ALSO
.Xr execve 2 ,
.Xr fork 2 ,
-.Xr posix_spawn_file_actions_init 3 ,
.Xr posix_spawn_file_actions_addclose 3 ,
+.Xr posix_spawn_file_actions_init 3 ,
.Xr posix_spawnattr_init 3 ,
.Xr posix_spawnattr_setflags 3
.Sh STANDARDS
diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3
index a23e2e30e52..a107550b93c 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.4 2012/04/11 09:38:45 espie Exp $
+.\" $OpenBSD: posix_spawn_file_actions_addopen.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -18,10 +18,10 @@
.Dt POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 3
.Os
.Sh NAME
-.Nm posix_spawn_file_actions_addclose
+.Nm posix_spawn_file_actions_addclose ,
.Nm posix_spawn_file_actions_adddup2 ,
-.Nm posix_spawn_file_actions_addopen ,
-.Nd "add action to close, dup2 or open file descriptor to file actions object"
+.Nm posix_spawn_file_actions_addopen
+.Nd add action to close, dup2 or open file descriptor to file actions object
.Sh SYNOPSIS
.In spawn.h
.Ft int
@@ -70,13 +70,11 @@ open(path, oflag, mode);
.Ed
.Pp
to be called and the result to be forced as
-.Fa fildes .
-.Po
-If
+.Fa fildes
+(if
.Fa fildes
was already open before this action, the old file descriptor
-is closed before the action is performed
-.Pc
+is closed before the action is performed).
.Pp
Note that
.Fn posix_spawn_file_actions_addopen
@@ -96,8 +94,7 @@ if they run out of memory.
.Xr posix_spawn_file_actions_init 3 ,
.Xr posix_spawnp 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_spawn_file_actions_init.3 b/lib/libc/gen/posix_spawn_file_actions_init.3
index 7897f642e19..e2467188a3d 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.4 2012/04/11 09:38:45 espie Exp $
+.\" $OpenBSD: posix_spawn_file_actions_init.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -43,15 +43,13 @@ The object should not be re-used after destruction.
It can however be initialized again with
.Fn posix_spawn_file_actions_init .
.Sh RETURN VALUES
-These function return 0 on succesful completion.
+These function return 0 on successful completion.
They may return
.Er ENOMEM
when running out of memory.
.Sh SEE ALSO
.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_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 db5c46a92a1..d8f13513805 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.4 2012/04/11 09:38:45 espie Exp $
+.\" $OpenBSD: posix_spawnattr_getflags.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -41,21 +41,19 @@ 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 child process to the parent's
-real user and group ID,
+real user and group ID;
see
-.Xr setegid 3
-and
-.Xr seteuid 3 .
+.Xr setegid 2 .
.Pp
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 the process group of the child process according to the pgroup attribute
-of the object, see
+of the object; see
.Xr posix_spawnattr_getpgroup 3
and
-.Xr setpgid 3 .
+.Xr setpgid 2 .
.It Dv POSIX_SPAWN_SETSIGDEF
Reset signals set by
.Xr posix_spawn_setsigdefault 3
@@ -65,7 +63,7 @@ Set the signal mask of the child process according
to the value set by
.Xr posix_spawnattr_setsigmask 3 ,
using
-.Xr sigprocmask 3 .
+.Xr sigprocmask 2 .
.It Dv POSIX_SPAWN_SETSCHEDPARAM
Set the scheduling parameter of the child process
according to the value set by
@@ -86,14 +84,13 @@ this implementation currently does nothing
.Pc .
.El
.Pp
-.Fn posix_spawnattr_init 3
+.Xr posix_spawnattr_init 3
initializes this value to no flags set.
.Sh RETURN VALUES
Both functions return 0.
.Sh SEE ALSO
.Xr posix_spawn 3 ,
-.Xr posix_spawnattr_init 3 ,
-.Xr posix_spawnp 3
+.Xr posix_spawnattr_init 3
.Sh STANDARDS
Both functions conform to
.St -p1003.1-2001 .
diff --git a/lib/libc/gen/posix_spawnattr_getpgroup.3 b/lib/libc/gen/posix_spawnattr_getpgroup.3
index 8082e2a8fd3..4f6d946eaee 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.4 2012/04/11 09:38:45 espie Exp $
+.\" $OpenBSD: posix_spawnattr_getpgroup.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -71,7 +71,6 @@ for attribute details.
Those functions return 0.
.Sh SEE ALSO
.Xr posix_spawn 3 ,
-.Xr posix_spawnattr_destroy 3 ,
.Xr posix_spawnattr_init 3 ,
.Xr sigsetops 3
.Sh STANDARDS
diff --git a/lib/libc/gen/posix_spawnattr_init.3 b/lib/libc/gen/posix_spawnattr_init.3
index fcf18b60dae..f9779d92371 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.4 2012/04/11 09:38:45 espie Exp $
+.\" $OpenBSD: posix_spawnattr_init.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
@@ -32,7 +32,7 @@
attributes objects can be initialized by
.Fn posix_spawnattr_init
and destroyed by
-.Fn posix_spawnattr_destroy.
+.Fn posix_spawnattr_destroy .
.Pp
Initialization fills an attributes object pointed by
.Fa attr
@@ -62,13 +62,12 @@ Attribute details are described in
Modifying or destroying attributes object
will not affect processes that have already been spawned.
.Sh RETURN VALUES
-These function return 0 on succesful completion.
+These function return 0 on successful completion.
They may return
.Er ENOMEM
when running out of memory.
.Sh SEE ALSO
-.Xr posix_spawn 3 ,
-.Xr posix_spawnp 3
+.Xr posix_spawn 3
.Sh STANDARDS
Both functions conform to
.St -p1003.1-2001 .