1 #ifndef WWW_WAIT_H
2 #define WWW_WAIT_H 1
3 
4 #include <HTUtils.h>
5 
6 #ifdef HAVE_SYS_WAIT_H
7 #include <sys/wait.h>
8 #endif
9 
10 #ifndef WEXITSTATUS
11 # ifdef HAVE_TYPE_UNIONWAIT
12 #  define	WEXITSTATUS(status)	(status.w_retcode)
13 # else
14 #  define	WEXITSTATUS(status)	(((status) & 0xff00) >> 8)
15 # endif
16 #endif
17 
18 #ifndef WTERMSIG
19 # ifdef HAVE_TYPE_UNIONWAIT
20 #  define	WTERMSIG(status)	(status.w_termsig)
21 # else
22 #  define	WTERMSIG(status)	((status) & 0x7f)
23 # endif
24 #endif
25 
26 #ifndef WSTOPSIG
27 # ifdef HAVE_TYPE_UNIONWAIT
28 #  define	WSTOPSIG(status)	(status.w_stopsig)
29 # else
30 #  define	WSTOPSIG(status)	WEXITSTATUS(status)
31 # endif
32 #endif
33 
34 #endif /* WWW_WAIT_H */
35