2 * wait.h - compensate for what vendors leave out
5 * Simon J. Gerraty <sjg@crufty.net>
9 * $Id: wait.h,v 1.6 2002/11/26 07:53:06 sjg Exp $
11 * @(#)Copyright (c) 1994, Simon J. Gerraty.
13 * This is free software. It comes with NO WARRANTY.
14 * Permission to use, modify and distribute this source code
15 * is granted subject to the following conditions.
16 * 1/ that the above copyright notice and this notice
17 * are preserved in all copies and that due credit be given
19 * 2/ that any changes to this code are clearly commented
20 * as such so that the author does not get blamed for bugs
23 * Please send copies of changes and bug-fixes to:
31 # define WEXITSTATUS(x) ((&x)->w_retcode)
32 # define WTERMSIG(x) ((&x)->w_termsig)
33 # define WSTOPSIG(x) ((&x)->w_stopsig)
39 # define WAIT_T union wait
40 # define WAIT_STATUS(x) (x).w_status
43 # define WAIT_STATUS(x) x
48 # define WEXITSTATUS(_X) (((int)(_X)>>8)&0377)
51 # define WSTOPPED 0177
54 # define WSTOPSIG(x) WSTOPPED
59 #define WSET_STOPCODE(x, sig) ((&x)->w_stopsig = (sig))
62 #define WSET_EXITCODE(x, ret, sig) ((&x)->w_termsig = (sig), (&x)->w_retcode = (ret))
66 #define WSET_STOPCODE(x, sig) ((x) = ((sig) << 8) | 0177)
69 #define WSET_EXITCODE(x, ret, sig) ((x) = (ret << 8) | (sig))
75 # define waitpid(pid, statusp, flags) wait4(pid, statusp, flags, (char *)0)
78 # define waitpid(pid, statusp, flags) wait3(statusp, flags, (char *)0)