summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/system.3
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1993-08-20 23:00:45 +0000
committerjtc <jtc@NetBSD.org>1993-08-20 23:00:45 +0000
commit67f034415c09cbba7948363de601d32db7ae5db5 (patch)
tree02cc53e082781fff928f84043819160524831e59 /lib/libc/stdlib/system.3
parent7a5661e6ac0f5e8d9ae862e2ef45c2120e611a3a (diff)
Upgraded to be 1003.2-92 compliant. The only functional change is
that -1 is returned when the fork fails. Updated implementation to use int rather than deprecated "union wait". Updated documentation to describe error / return values.
Diffstat (limited to 'lib/libc/stdlib/system.3')
-rw-r--r--lib/libc/stdlib/system.339
1 files changed, 22 insertions, 17 deletions
diff --git a/lib/libc/stdlib/system.3 b/lib/libc/stdlib/system.3
index b372b7d635a..4ec00b25954 100644
--- a/lib/libc/stdlib/system.3
+++ b/lib/libc/stdlib/system.3
@@ -34,7 +34,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)system.3 6.5 (Berkeley) 6/29/91
-.\" $Id: system.3,v 1.2 1993/08/01 07:44:14 mycroft Exp $
+.\" $Id: system.3,v 1.3 1993/08/20 23:00:45 jtc Exp $
.\"
.Dd June 29, 1991
.Dt SYSTEM 3
@@ -54,8 +54,7 @@ hands the argument
.Fa string
to the command interpreter
.Xr sh 1 .
-The calling process waits for the shell
-to finish executing the command,
+The calling process waits for the shell to finish executing the command,
ignoring
.Dv SIGINT
and
@@ -69,26 +68,32 @@ is a
.Dv NULL
pointer,
.Fn system
-will return non-zero if the command interpreter
-.Xr sh 1
-is available, and zero if it is not.
-.Pp
-The
+will return non-zero.
+Otherwise,
.Fn system
-function
-returns the exit status of the shell, or \-1 if the
-.Xr wait 3
-for the shell failed.
-A return value of 127 means the execution of the shell
-failed.
+returns the termination status of the shell in the format specified by
+.Xr waitpid 3 .
+.Sh DIAGNOSTICS
+If a child process cannot be created, or the termination status of
+the shell cannot be obtained,
+.Fn system
+returns -1 and sets
+.Va errno
+to indicate the error.
+If execution of the shell fails,
+.Fn system
+returns the termination status for a program that terminates with a call of
+.Fn exit 127 .
.Sh SEE ALSO
.Xr sh 1 ,
.Xr execve 2 ,
-.Xr wait 2 ,
-.Xr popen 3
+.Xr popen 3 ,
+.Xr waitpid 3 ,
.Sh STANDARDS
The
.Fn system
function
conforms to
-.St -ansiC .
+.St -ansiC
+and
+.St -1003.2-92 .