gdb-3.5
[deliverable/binutils-gdb.git] / gdb / wait.h
1
2 /* Define how to access the structure that the wait system call stores.
3 On many systems, there is a structure defined for this.
4 But on vanilla-ish USG systems there is not. */
5
6 #ifndef HAVE_WAIT_STRUCT
7 #define WAITTYPE int
8 #define WIFSTOPPED(w) (((w)&0377) == 0177)
9 #define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
10 #define WIFEXITED(w) (((w)&0377) == 0)
11 #define WRETCODE(w) ((w) >> 8)
12 #define WSTOPSIG(w) ((w) >> 8)
13 #define WCOREDUMP(w) (((w)&0200) != 0)
14 #define WTERMSIG(w) ((w) & 0177)
15 #define WSETEXIT(w, status) ((w) = (status))
16 #define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
17 #else
18 #include <sys/wait.h>
19 #define WAITTYPE union wait
20 #define WRETCODE(w) (w).w_retcode
21 #define WSTOPSIG(w) (w).w_stopsig
22 #define WCOREDUMP(w) (w).w_coredump
23 #define WTERMSIG(w) (w).w_termsig
24 #define WSETEXIT(w, status) ((w).w_status = (status))
25 #define WSETSTOP(w,sig) \
26 ((w).w_stopsig = (sig), (w).w_coredump = 0, (w).w_termsig = 0177)
27 #endif
This page took 0.04794 seconds and 4 git commands to generate.