Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

system(3) Guardian Native C Library Calls Reference Manual
If command is not a null pointer, upon successful completion, the system() function
returns the exit status of the executed command in the format specied by the waitpid( )
function (see the wait(2) reference page). If the function fails, such as when the child
process cannot be created or if the shells exit status cannot be obtained, the system()
function returns a value of -1 and sets errno to indicate the error. A return value of 127
indicates that the shell could not be executed.
The following return values apply to the system() function called from Guardian processes:
If the command parameter is a null pointer, the system() function returns a value of 1 if a
command processor (a running TACL process) is available.
If command is not a null pointer, upon successful completion of the call to TACL, the
system() function returns 0 (zero). A return value of 0 (zero) does not necessarily indi-
cate that the command passed to TACL nished successfully.
If the system() function call fails, a returned nonzero value other than 1 is a Guardian
error number returned by TACL.
ERRORS
In OSS processes, if any of the following conditions occurs, the system() function sets errno to
the corresponding value:
[EAGAIN] The system-imposed limit on the total number of processes under execution sys-
temwide (PROC_MAX), or by a single user ID (CHILD_MAX), would be
exceeded.
[EINTR] The system( ) function was interrupted by a signal that was caught.
[ENOMEM] There is not enough space left for this process.
In Guardian processes, the return of a 0 (zero) value does not necessarily indicate that the
requested operation has nished successfully. The application should query the TACL process
for an indication of the success or failure of the operation.
The Guardian version of the system() function does not set errno.
RELATED INFORMATION
Functions: exec(2), exit(2), fork(2), tdm_fork(2), tdm_spawn(2), tdm_spawnp(2), wait(2).
Commands: gtacl(1), sh(1).
STANDARDS CONFORMANCE
The system( ) function behavior in Guardian processes is an HP extension to the XPG4 Version 2
specication.
6102 Hewlett-Packard Company 527192-005