date and time created 90/05/16 13:01:54 by bostic
[unix-history] / usr / src / lib / libc / stdlib / system.3
CommitLineData
a83c1154
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\" @(#)system.3 6.2 (Berkeley) %G%
6363d9ff 7.\"
929cacff 8.TH SYSTEM 3 ""
6363d9ff
KM
9.AT 3
10.SH NAME
11system \- issue a shell command
12.SH SYNOPSIS
13.nf
a83c1154
KB
14.ft B
15system(const char *string);
16.ft R
6363d9ff
KM
17.fi
18.SH DESCRIPTION
19.I System
a83c1154 20hands
6363d9ff 21.I string
a83c1154
KB
22to the command interpreter
23.IR sh (1).
24The calling process waits until the shell has completed,
25ignoring SIGINT and SIGQUIT, and blocking SIGCHLD.
26.PP
27If
28.I string
29is a NULL pointer,
30.I system
31will return non-zero if the command interpreter
32.IR sh (1)
33is available, and zero if it is not.
34.PP
35.I System
36returns the exit status of the shell, or \-1 if the
37.IR wait (3)
38for the shell failed.
39A return status of 127 indicates that the execution of the shell
40failed.
6363d9ff 41.SH "SEE ALSO"
a83c1154
KB
42sh(1), execve(2), wait(2), popen(3)
43.SH STANDARDS
44.B System
45conforms to ANSI X3.159-1989 (``ANSI C'').