wait for child process to change state
cc . . . -lc
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
waitid suspends the calling process until one of its
children changes state. It records the current state of a child in
the siginfo_t structure pointed to by infop. If
a child process changed state prior to the call to waitid,
waitid returns immediately.
The idtype and id arguments specify which
children waitid is to wait for.
The options argument is used to specify which state
changes waitid is to wait for. It is formed by an
OR of any of the following flags:
If idtype is P_PID, waitid waits for
the child with a process ID equal to
If idtype is P_PGID, waitid waits for
any child with a process group ID equal to
If idtype is P_ALL, waitid waits for
any children and id is ignored.
infop must point to a siginfo_t structure, as
siginfo_t is filled in by the system with the status of
the process being waited for.
Wait for process(es) to exit.
Wait for traced process(es) to become trapped or reach a breakpoint
Wait for and return the process status of any child that has stopped
upon receipt of a signal.
Return the status for any child that was stopped and has been
Keep the process in a waitable state. This will not affect the state
of the process on subsequent waits.
If waitid returns due to a change of state of one of its
children, it returns 0. Otherwise, waitid returns -1 and
sets errno to identify the error.
In the following conditions, waitid fails and sets
infop points to an invalid address.
waitid was interrupted due to the receipt of a signal by
the calling process.
No options were specified or an invalid value was specified for
idtype and id specify an invalid set of
The set of processes specified by idtype and id
does not contain any unwaited-for processes.
waitid is conformant with:
AT&T SVID Issue 3.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003