This commit sets new users to see the DragonFly-tips fortunes instead
[dragonfly.git] / contrib / tcsh / mi.wait.h
blob205ac6812df6582e6349072308deb87ef3c77f93
1 /* The <sys/wait.h> header contains macros related to wait(). The value
2 * returned by wait() and waitpid() depends on whether the process
3 * terminated by an exit() call, was killed by a signal, or was stopped
4 * due to job control, as follows:
6 * High byte Low byte
7 * +---------------------+
8 * exit(status) | status | 0 |
9 * +---------------------+
10 * killed by signal | 0 | signal |
11 * +---------------------+
12 * stopped (job control) | signal | 0177 |
13 * +---------------------+
16 #ifndef _WAIT_H
17 #define _WAIT_H
19 #ifndef _TYPES_H /* not quite right */
20 #include <sys/types.h>
21 #endif
23 #define __LOW(v) ((v) & 0377)
24 #define __HIGH(v) (((v) >> 8) & 0377)
26 #define WNOHANG 1 /* do not wait for child to exit */
27 #define WUNTRACED 2 /* for job control; not implemented */
29 #define WIFEXITED(s) (__LOW(s) == 0) /* normal exit */
30 #define WEXITSTATUS(s) (__HIGH(s)) /* exit status */
31 #define WTERMSIG(s) (__LOW(s) & 0177) /* sig value */
32 #define WIFSIGNALED(s) ((((unsigned int)(s)-1) & 0xFFFF) < 0xFF) /* signaled */
33 #define WIFSTOPPED(s) (__LOW(s) == 0177) /* stopped */
34 #define WSTOPSIG(s) (__HIGH(s) & 0377) /* stop signal */
36 /* Function Prototypes. */
37 #ifndef _ANSI_H
38 #include <ansi.h>
39 #endif
41 _PROTOTYPE( pid_t wait, (int *_stat_loc) );
42 _PROTOTYPE( pid_t waitpid, (pid_t _pid, int *_stat_loc, int _options) );
44 #endif /* _WAIT_H */