diff options
Diffstat (limited to 'src/lib/libc/stdlib/system.3')
-rw-r--r-- | src/lib/libc/stdlib/system.3 | 44 |
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 |
50 | The | 49 | The |
51 | .Fn system | 50 | .Fn system |
52 | function | 51 | function hands the argument |
53 | hands the argument | ||
54 | .Fa string | 52 | .Fa string |
55 | to the command interpreter | 53 | to the command interpreter |
56 | .Xr sh 1 . | 54 | .Xr sh 1 . |
@@ -64,36 +62,42 @@ and blocking | |||
64 | .Pp | 62 | .Pp |
65 | If | 63 | If |
66 | .Fa string | 64 | .Fa string |
67 | is a | 65 | is |
68 | .Dv NULL | 66 | .Dv NULL , |
69 | pointer, | ||
70 | .Fn system | 67 | .Fn system |
71 | will return non-zero. | 68 | will return non-zero. |
72 | Otherwise, | 69 | Otherwise, |
73 | .Fn system | 70 | .Fn system |
74 | returns the termination status of the shell in the format specified by | 71 | returns 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 |
77 | If a child process cannot be created, or the termination status of | 74 | If a child process cannot be created, or the termination status of |
78 | the shell cannot be obtained, | 75 | the shell cannot be obtained, |
79 | .Fn system | 76 | .Fn system |
80 | returns -1 and sets | 77 | returns \-1 and sets |
81 | .Va errno | 78 | .Va errno |
82 | to indicate the error. | 79 | to indicate the error. |
83 | If execution of the shell fails, | 80 | If execution of the shell fails, |
84 | .Fn system | 81 | .Fn system |
85 | returns the termination status for a program that terminates with a call of | 82 | returns 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 |
93 | The | 90 | The |
94 | .Fn system | 91 | .Fn system |
95 | function | 92 | function conforms to |
96 | conforms to | 93 | .St -ansiC |
97 | .St -ansiC | ||
98 | and | 94 | and |
99 | .St -1003.2-92 . | 95 | .St -p1003.2-92 . |
96 | .Sh CAVEATS | ||
97 | Never supply the | ||
98 | .Fn system | ||
99 | function with a command containing any part of an unsanitized user-supplied | ||
100 | string. | ||
101 | Shell meta-characters present will be honored by the | ||
102 | .Xr sh 1 | ||
103 | command interpreter. | ||