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