Subversion Repositories tendra.SVN

Rev

Rev 74 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#define _W_INT(i)       (i)

#define _WSTATUS(x)     (_W_INT(x) & 0177)
#define _WSTOPPED       0177            /* _WSTATUS if process is stopped */
#define WIFSTOPPED(x)   (_WSTATUS(x) == _WSTOPPED)
#define WSTOPSIG(x)     (_W_INT(x) >> 8)
#define WIFSIGNALED(x)  (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0 && (x) != 0x13)
#define WTERMSIG(x)     (_WSTATUS(x))
#define WIFEXITED(x)    (_WSTATUS(x) == 0)
#define WEXITSTATUS(x)  (_W_INT(x) >> 8)
#define WIFCONTINUED(x) (x == 0x13)     /* 0x13 == SIGCONT */
#if __BSD_VISIBLE
#define WCOREDUMP(x)    (_W_INT(x) & WCOREFLAG)

#define W_EXITCODE(ret, sig)    ((ret) << 8 | (sig))
#define W_STOPCODE(sig)         ((sig) << 8 | _WSTOPPED)
#endif

/*
 * Option bits for the third argument of wait4.  WNOHANG causes the
 * wait to not hang if there are no stopped or terminated processes, rather
 * returning an error indication in this case (pid==0).  WUNTRACED
 * indicates that the caller should receive status about untraced children
 * which stop due to signals.  If children are stopped and a wait without
 * this option is done, it is as though they were still running... nothing
 * about them is returned. WNOWAIT only request information about zombie,
 * leaving the proc around, available for later waits.
 */
#define WNOHANG         1       /* Don't hang in wait. */
#define WUNTRACED       2       /* Tell about stopped, untraced children. */
#define WSTOPPED        WUNTRACED   /* SUS compatibility */
#define WCONTINUED      4       /* Report a job control continued process. */
#define WNOWAIT         8       /* Poll only. Don't delete the proc entry. */
#define WEXITED         16      /* Wait for exited processes. */
#define WTRAPPED        32      /* Wait for a process to hit a trap or
                                   a breakpoint. */