Process waitfor() should have more options as those available for wait(2) and waitpid(2) system calls in Solaris.
Please take a look at the man pages for wait() and waitpid() in Solaris. It allows the calling thread to identify the cause of the child process status change. Some of the options available for waitpid() are:
pid_t waitpid(pid_t pid, int *stat_loc, int options);
The options argument is constructed from the bitwise
inclusive OR of zero or more of the following flags, defined
in the header <sys/wait.h>:
WCONTINUED
The status of any continued child process specified by
pid, whose status has not been reported since it con-
tinued, is also reported to the calling process.
WNOHANG
waitpid() will not suspend execution of the calling
process if status is not immediately available for one
of the child processes specified by pid.
WNOWAIT
Keep the process whose status is returned in stat_loc
in a waitable state. The process may be waited for
again with identical results.
WUNTRACED
The status of any child processes specified by pid
that are stopped, and whose status has not yet been
reported since they stopped, is also reported to the
calling process.
Please take a look at the man pages for wait() and waitpid() in Solaris. It allows the calling thread to identify the cause of the child process status change. Some of the options available for waitpid() are:
pid_t waitpid(pid_t pid, int *stat_loc, int options);
The options argument is constructed from the bitwise
inclusive OR of zero or more of the following flags, defined
in the header <sys/wait.h>:
WCONTINUED
The status of any continued child process specified by
pid, whose status has not been reported since it con-
tinued, is also reported to the calling process.
WNOHANG
waitpid() will not suspend execution of the calling
process if status is not immediately available for one
of the child processes specified by pid.
WNOWAIT
Keep the process whose status is returned in stat_loc
in a waitable state. The process may be waited for
again with identical results.
WUNTRACED
The status of any child processes specified by pid
that are stopped, and whose status has not yet been
reported since they stopped, is also reported to the
calling process.