[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.21.9.2 Wait

Function: sys-wait
[POSIX] Calls system's wait(2). The process suspends its execution until one of the child terminates. Returns two exact integer values, the first one is the child's process id, and the second is a status code. The status code can be interpreted by the following functions.

Function: sys-waitpid pid &keyword nohang untraced
[POSIX] This is an interface to waitpid(3), an extended version of wait.

pid is an exact integer specifying which child(ren) it's waiting. If it is a positive integer, it waits fot that specific child. If it is zero, it waits for any member of this process group. If it is -1, it waits for any child process. If it is less than -1, it waits for any child process whose process group id is equal to the absolute value of pid.

The calling process suspends until one of those child process is terminated, unless true is specified to the keyword argument nohang.

If true is specified to the keyword argument untraced, the status of stopped child process can be also returned.

The return values are two exact integers, the first one is the child process id, and the second is a status code. If nohang is true and no child process status is available, the first value is zero.

Function: sys-wait-exited? status
Function: sys-wait-exit-status status
[POSIX] The argument is an exit status returned as a second value from sys-wait or sys-waitpid. sys-wait-exited? returns #t if the child process is terminated normally. sys-wait-exit-status returns the exit code the child process passed to exit(2), or the return value of main().

Function: sys-wait-signaled? status
Function: sys-wait-termsig status
[POSIX] The argument is an exit status returned as a second value from sys-wait or sys-waitpid. sys-wait-signaled? returns #t if the child process is termintaed by an uncaught signal. sys-wait-termsig returns the signal number that terminted the child.

Function: sys-wait-stopped? status
Function: sys-wait-stopsig status
[POSIX] The argument is an exit status returned as a second value from sys-waitpid. sys-wait-stopped? returns #t if the child process is stopped. This status can be caught only by sys-waitpid with true untraced argument. sys-wait-stopsig returns the signum number that stopped the child.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Ken Dickey on November, 28 2002 using texi2html