Next: , Previous: , Up: posix   [Index]


4.7 Process termination status.

Function: waitpid pid options

Interface to the C function waitpid(), (libc)waitpid. Request status informations on a process or group of processes knowing the identifier.

The fixnum pid selects the target of the request; the fixnum options must be the logical OR (fxior) of platform specific constants specifying how to wait for the availability of the status.

Upon returning behave as follows:

Function: wait

Interface to the C function wait(), (libc)wait. Request status informations on any process or group of processes. If successful return a fixnum representing the status; if an error occurs: an exception is raised.

The following functions accept as argument a fixnum representing the process termination status, for example the return value of system or the status acquired by waitpid.

Function: WIFEXITED status

Interface to the C macro WIFEXITED(), (libc)WIFEXITED. Return true if the process terminated normally with exit().

Function: WEXITSTATUS status

Interface to the C macro WEXITSTATUS(), (libc)WEXITSTATUS. If WIFEXITED applied to status would return true: return the low–order 8 bits from the exit status, which is the process exit status selected with exit().

Function: WIFSIGNALED status

Interface to the C macro WIFSIGNALED(), (libc)WIFSIGNALED. Return true if the process terminated because it received an interprocess signal which was not handled.

Function: WTERMSIG status

Interface to the C macro WTERMSIG(), (libc)WTERMSIG. If WIFSIGNALED applied to status would return true: return the number of the interprocess signal that terminated the process.

Function: WCOREDUMP status

Interface to the C macro WCOREDUMP(), (libc)WCOREDUMP. Return true if the process terminated and produced a core dump.

Function: WIFSTOPPED status

Interface to the C macro WIFSTOPPED(), (libc)WIFSTOPPED. Return true if the process is stopped.

Function: WSTOPSIG status

Interface to the C macro WSTOPSIG(), (libc)WSTOPSIG. If WIFSTOPPED applied to status would return true: return the number of the interprocess signal that caused the process to stop.


Next: , Previous: , Up: posix   [Index]