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