diff options
author | Christopher Faylor <cgf@redhat.com> | 2000-02-17 19:39:46 +0000 |
---|---|---|
committer | Christopher Faylor <cgf@redhat.com> | 2000-02-17 19:39:46 +0000 |
commit | 6d491d8ad9122891d1a48447e8c49702eb678921 (patch) | |
tree | 45619a131b9f211ceca9fce7a866328344bf00ec /newlib/libc/sys/sysvi386/sys/wait.h | |
parent | bd592806f45307757c24ec3f75bdefe13abfd51f (diff) | |
download | gdb-cvs/SNAPSHOT.tar.gz |
import newlib-2000-02-17 snapshotcvs/SNAPSHOT
Diffstat (limited to 'newlib/libc/sys/sysvi386/sys/wait.h')
-rw-r--r-- | newlib/libc/sys/sysvi386/sys/wait.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/newlib/libc/sys/sysvi386/sys/wait.h b/newlib/libc/sys/sysvi386/sys/wait.h new file mode 100644 index 00000000000..7c36f32db8c --- /dev/null +++ b/newlib/libc/sys/sysvi386/sys/wait.h @@ -0,0 +1,42 @@ +#ifndef _WAIT_H +# define _WAIT_H + +# define WNOHANG 1 +# define WUNTRACED 2 + +/* + * Unlike the atrocity that BSD ended up using, we do not have a "union + * wait," although I could probably implement one. Given the code I + * sometimes end up porting, it might be a good thing. Anyway, the + * format of a stat thingy, filled in by the wait*() routines, is: + * struct { + * int filler:16; + * union { + * struct stopped { + * int signo:8; + * int o177:8; // will be 0177 + * }; + * struct exited { + * int retval:8; + * int zero:8; // 0, obviously 8-) + * }; + * struct termed { + * int zero:8; // zeroes + * int corep:1; // was there a core file? + * int signo:7; // what?! Only 127 signals?! + * }; + * int value:16; + * }; + * }; + * + * Braver souls than I can turn that into a union wait, if desired. Ick. + */ + +# define WIFEXITED(val) ((val)&0xff) +# define WEXITSTATUS(val) (((val)>>8)&0xff) +# define WIFSIGNALED(val) ((val) && !((val)&0xff)) +# define WTERMSIG(val) (((val)>>8)&0x7f) +# define WIFSTOPPED(val) (((val)&0xff)==0177) +# define WSTOPSIG(val) (((val)>>8)&0xff) +#endif /* _SYS_WAIT_H */ + |