diff options
Diffstat (limited to 'man3/system.3')
-rw-r--r-- | man3/system.3 | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/man3/system.3 b/man3/system.3 index fb5d0af6b..04e712edb 100644 --- a/man3/system.3 +++ b/man3/system.3 @@ -25,11 +25,11 @@ Standard C library The .BR system () library function behaves as if it used -.BR fork (2) +.MR fork 2 to create a child process that executed the shell command specified in .I command using -.BR execl (3) +.MR execl 3 as follows: .P .in +4n @@ -76,7 +76,7 @@ is set to indicate the error. .IP \[bu] If a shell could not be executed in the child process, then the return value is as though the child shell terminated by calling -.BR _exit (2) +.MR _exit 2 with the status 127. .IP \[bu] If all system calls succeed, @@ -89,7 +89,7 @@ the last command it executes.) In the last two cases, the return value is a "wait status" that can be examined using the macros described in -.BR waitpid (2). +.MR waitpid 2 . (i.e., .BR WIFEXITED (), .BR WEXITSTATUS (), @@ -100,10 +100,10 @@ does not affect the wait status of any other children. .SH ERRORS .BR system () can fail with any of the same errors as -.BR fork (2). +.MR fork 2 . .SH ATTRIBUTES For an explanation of the terms used in this section, see -.BR attributes (7). +.MR attributes 7 . .TS allbox; lbx lb lb @@ -123,10 +123,10 @@ POSIX.1-2001, C89. .BR system () provides simplicity and convenience: it handles all of the details of calling -.BR fork (2), -.BR execl (3), +.MR fork 2 , +.MR execl 3 , and -.BR waitpid (2), +.MR waitpid 2 , as well as the necessary manipulations of signals; in addition, the shell performs the usual substitutions and I/O redirections for @@ -144,7 +144,7 @@ feature test macro is defined .I any header files), then the macros described in -.BR waitpid (2) +.MR waitpid 2 .RB ( WEXITSTATUS (), etc.) are made available when including .IR <stdlib.h> . @@ -173,7 +173,7 @@ while (something) { .in .P According to POSIX.1, it is unspecified whether handlers registered using -.BR pthread_atfork (3) +.MR pthread_atfork 3 are called during the execution of .BR system (). In the glibc implementation, such handlers are not called. @@ -189,7 +189,7 @@ Since glibc 2.1.3, this check is performed because, even though POSIX.1-2001 requires a conforming implementation to provide a shell, that shell may not be available or executable if the calling program has previously called -.BR chroot (2) +.MR chroot 2 (which is not specified by POSIX.1-2001). .P It is possible for the shell command to terminate with a status of 127, @@ -210,11 +210,11 @@ For example, could be manipulated so that an arbitrary program is executed with privilege. Use the -.BR exec (3) +.MR exec 3 family of functions instead, but not -.BR execlp (3) +.MR execlp 3 or -.BR execvp (3) +.MR execvp 3 (which also use the .B PATH environment variable to search for an executable). @@ -225,7 +225,7 @@ set-group-ID privileges on systems on which .I /bin/sh is bash version 2: as a security measure, bash 2 drops privileges on startup. (Debian uses a different shell, -.BR dash (1), +.MR dash 1 , which does not do this when invoked as .BR sh .) .P @@ -243,13 +243,13 @@ from a privileged program. .\" [glibc bug](https://sourceware.org/bugzilla/show_bug.cgi?id=27143) .\" [POSIX bug](https://www.austingroupbugs.net/view.php?id=1440) If the command name starts with a hyphen, -.BR sh (1) +.MR sh 1 interprets the command name as an option, and the behavior is undefined. (See the .B \-c option to -.BR sh (1).) +.MR sh 1 .) To work around this problem, prepend the command with a space as in the following call: .P @@ -259,11 +259,11 @@ prepend the command with a space as in the following call: .EE .in .SH SEE ALSO -.BR sh (1), -.BR execve (2), -.BR fork (2), -.BR sigaction (2), -.BR sigprocmask (2), -.BR wait (2), -.BR exec (3), -.BR signal (7) +.MR sh 1 , +.MR execve 2 , +.MR fork 2 , +.MR sigaction 2 , +.MR sigprocmask 2 , +.MR wait 2 , +.MR exec 3 , +.MR signal 7 |