issue a shell command
cc . . . -lc
int system (string)
The system function causes the
string to be given to
as input, as if the string had been typed as a command
at a terminal.
The current process waits until the shell has
If string is not a null pointer,
returns the exit status of the shell in the same format
as specified by the
The meaning of the return value,
if it is not -1,
can be decoded
via macros like WIFEXITED
defined in <sys/wait.h>, as described in
The system function
forks to create a child process
that in turn executes (using
/bin/sh in order to execute
If the fork fails, system
returns -1 and sets errno.
If the fork succeeds but exec fails, system
returns a value as if
had terminated using
The system function fails if:
The system-imposed limit on the total number of processes under
execution, system-wide, or by a single user ID
(CHILD_MAX), would be exceeded.
Insufficient storage space is available.
system is conformant with:
X/Open Portability Guide, Issue 3, 1989
ANSI X3.159-1989 Programming Language -- C
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003