summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/system.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/system.3')
-rw-r--r--src/lib/libc/stdlib/system.344
1 files changed, 24 insertions, 20 deletions
diff --git a/src/lib/libc/stdlib/system.3 b/src/lib/libc/stdlib/system.3
index 520f51db0a..83c6de80e3 100644
--- a/src/lib/libc/stdlib/system.3
+++ b/src/lib/libc/stdlib/system.3
@@ -33,8 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" from: @(#)system.3 6.5 (Berkeley) 6/29/91 36.\" $OpenBSD: system.3,v 1.8 2000/10/06 04:17:51 aaron Exp $
37.\" $Id: system.3,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $
38.\" 37.\"
39.Dd June 29, 1991 38.Dd June 29, 1991
40.Dt SYSTEM 3 39.Dt SYSTEM 3
@@ -49,8 +48,7 @@
49.Sh DESCRIPTION 48.Sh DESCRIPTION
50The 49The
51.Fn system 50.Fn system
52function 51function hands the argument
53hands the argument
54.Fa string 52.Fa string
55to the command interpreter 53to the command interpreter
56.Xr sh 1 . 54.Xr sh 1 .
@@ -64,36 +62,42 @@ and blocking
64.Pp 62.Pp
65If 63If
66.Fa string 64.Fa string
67is a 65is
68.Dv NULL 66.Dv NULL ,
69pointer,
70.Fn system 67.Fn system
71will return non-zero. 68will return non-zero.
72Otherwise, 69Otherwise,
73.Fn system 70.Fn system
74returns the termination status of the shell in the format specified by 71returns the termination status of the shell in the format specified by
75.Xr waitpid 3 . 72.Xr waitpid 2 .
76.Sh RETURN VALUES 73.Sh RETURN VALUES
77If a child process cannot be created, or the termination status of 74If a child process cannot be created, or the termination status of
78the shell cannot be obtained, 75the shell cannot be obtained,
79.Fn system 76.Fn system
80returns -1 and sets 77returns \-1 and sets
81.Va errno 78.Va errno
82to indicate the error. 79to indicate the error.
83If execution of the shell fails, 80If execution of the shell fails,
84.Fn system 81.Fn system
85returns the termination status for a program that terminates with a call of 82returns the termination status for a program that terminates with a call of
86.Fn exit 127 . 83.Fn exit 127 .
87.Sh SEE ALSO 84.Sh SEE ALSO
88.Xr sh 1 , 85.Xr sh 1 ,
89.Xr execve 2 , 86.Xr execve 2 ,
90.Xr popen 3 , 87.Xr waitpid 2 ,
91.Xr waitpid 3 , 88.Xr popen 3
92.Sh STANDARDS 89.Sh STANDARDS
93The 90The
94.Fn system 91.Fn system
95function 92function conforms to
96conforms to 93.St -ansiC
97.St -ansiC
98and 94and
99.St -1003.2-92 . 95.St -p1003.2-92 .
96.Sh CAVEATS
97Never supply the
98.Fn system
99function with a command containing any part of an unsanitized user-supplied
100string.
101Shell meta-characters present will be honored by the
102.Xr sh 1
103command interpreter.