waitid(2) waitid(2)
NAME
waitid - wait for child process to change state
SYNOPSIS
#include <sys/types.h>
#include <wait.h>
int waitid(idtypet idtype, idt id, siginfot *infop, int options);
DESCRIPTION
waitid suspends the calling process until one of its children changes
state. It records the current state of a child in the 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.
If idtype is PPID, waitid waits for the child with a process ID
equal to (pidt) id.
If idtype is PPGID, waitid waits for any child with a process group
ID equal to (pidt)id.
If idtype is PALL, waitid waits for any children and id is ignored.
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:
WEXITED Wait for process(es) to exit.
WTRAPPED Wait for traced process(es) to become trapped or reach a
breakpoint (see ptrace(2)).
WSTOPPED Wait for and return the process status of any child that
has stopped upon receipt of a signal.
WCONTINUED Return the status for any child that was stopped and has
been continued.
WNOHANG Return immediately.
WNOWAIT Keep the process in a waitable state.
infop must point to a siginfot structure, as defined in siginfo(5).
siginfot is filled in by the system with the status of the process being
waited for.
waitid fails if one or more of the following is true.
EFAULT infop points to an invalid address.
Page 1