1: /*
2: * this file holds definitions relevent to the (new) wait2 system call
3: * this system call is similar to the standard "wait" system call
4: * except that it has a second argument whose bits indicate certain
5: * options to the behavior of the system call
6: */
7:
8: /*
9: * structure of the int returned in the "int" pointed to by the
10: * first argument to the system call. two substructures are distinguished
11: * by a test: if (w_stopval == WSTOPPED) then the second one applies
12: * other wise the first one applies.
13: */
14:
15: union wait {
16: int w_status; /* to keep lint happy - used
17: (with &) in actual syscall*/
18: struct { /* to keep the code readable? */
19: short w_Termsig:7; /* termination signal */
20: short w_Coredump:1; /* core dump indicator */
21: short w_Retcode:8; /* program return code via exit
22: valid if w_termsig == 0 */
23: } w_T; /* terminated process status */
24: struct {
25: short w_Stopval:8; /* stop value flag */
26: short w_Stopsig:8; /* signal that stopped us */
27: } w_S; /* stopped process status */
28: };
29: #define w_termsig w_T.w_Termsig
30: #define w_coredump w_T.w_Coredump
31: #define w_retcode w_T.w_Retcode
32: #define w_stopval w_S.w_Stopval
33: #define w_stopsig w_S.w_Stopsig
34:
35:
36: #define WSTOPPED 0177 /* value of s.stopval if process is stopped */
37:
38: #define WNOHANG 1 /* option bit indicating that the caller should
39: not hang if no child processes have stopped
40: or terminated, but rather return zero as th
41: process id */
42: #define WUNTRACED 2 /* option bit indicating that the caller should
43: receive status about untraced children that
44: stop due to signals. The default is that
45: the caller never sees status for such
46: processes, thus they appear to stay in the
47: running state even though they are in fact
48: stopped. */
49: #define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED)
50: #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0)
51: #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0)
Defined union's
wait
defined in line
15; used 10 times
Defined macros
Usage of this include