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.350
1 files changed, 25 insertions, 25 deletions
diff --git a/src/lib/libc/stdlib/system.3 b/src/lib/libc/stdlib/system.3
index 520f51db0a..1034b01066 100644
--- a/src/lib/libc/stdlib/system.3
+++ b/src/lib/libc/stdlib/system.3
@@ -13,11 +13,7 @@
13.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the 14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution. 15.\" documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software 16.\" 3. Neither the name of the University nor the names of its contributors
17.\" must display the following acknowledgement:
18.\" This product includes software developed by the University of
19.\" California, Berkeley and its contributors.
20.\" 4. Neither the name of the University nor the names of its contributors
21.\" may be used to endorse or promote products derived from this software 17.\" may be used to endorse or promote products derived from this software
22.\" without specific prior written permission. 18.\" without specific prior written permission.
23.\" 19.\"
@@ -33,8 +29,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
35.\" 31.\"
36.\" from: @(#)system.3 6.5 (Berkeley) 6/29/91 32.\" $OpenBSD: system.3,v 1.9 2003/06/02 20:18:38 millert Exp $
37.\" $Id: system.3,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $
38.\" 33.\"
39.Dd June 29, 1991 34.Dd June 29, 1991
40.Dt SYSTEM 3 35.Dt SYSTEM 3
@@ -49,8 +44,7 @@
49.Sh DESCRIPTION 44.Sh DESCRIPTION
50The 45The
51.Fn system 46.Fn system
52function 47function hands the argument
53hands the argument
54.Fa string 48.Fa string
55to the command interpreter 49to the command interpreter
56.Xr sh 1 . 50.Xr sh 1 .
@@ -64,36 +58,42 @@ and blocking
64.Pp 58.Pp
65If 59If
66.Fa string 60.Fa string
67is a 61is
68.Dv NULL 62.Dv NULL ,
69pointer,
70.Fn system 63.Fn system
71will return non-zero. 64will return non-zero.
72Otherwise, 65Otherwise,
73.Fn system 66.Fn system
74returns the termination status of the shell in the format specified by 67returns the termination status of the shell in the format specified by
75.Xr waitpid 3 . 68.Xr waitpid 2 .
76.Sh RETURN VALUES 69.Sh RETURN VALUES
77If a child process cannot be created, or the termination status of 70If a child process cannot be created, or the termination status of
78the shell cannot be obtained, 71the shell cannot be obtained,
79.Fn system 72.Fn system
80returns -1 and sets 73returns \-1 and sets
81.Va errno 74.Va errno
82to indicate the error. 75to indicate the error.
83If execution of the shell fails, 76If execution of the shell fails,
84.Fn system 77.Fn system
85returns the termination status for a program that terminates with a call of 78returns the termination status for a program that terminates with a call of
86.Fn exit 127 . 79.Fn exit 127 .
87.Sh SEE ALSO 80.Sh SEE ALSO
88.Xr sh 1 , 81.Xr sh 1 ,
89.Xr execve 2 , 82.Xr execve 2 ,
90.Xr popen 3 , 83.Xr waitpid 2 ,
91.Xr waitpid 3 , 84.Xr popen 3
92.Sh STANDARDS 85.Sh STANDARDS
93The 86The
94.Fn system 87.Fn system
95function 88function conforms to
96conforms to 89.St -ansiC
97.St -ansiC
98and 90and
99.St -1003.2-92 . 91.St -p1003.2-92 .
92.Sh CAVEATS
93Never supply the
94.Fn system
95function with a command containing any part of an unsanitized user-supplied
96string.
97Shell meta-characters present will be honored by the
98.Xr sh 1
99command interpreter.