1 2 #ifndef __SYS_WAIT_H__ 3 #define __SYS_WAIT_H__ 4 5 #include <sys/cdefs.h> 6 7 /* Extract the status code from the status */ 8 #define WEXITSTATUS(_x) (_x & 0x000000ff) 9 #define _WSTATUS(_x) ((_x & 0x0000ff00) >> 8) 10 /* Exited gracefully */ 11 #define WIFEXITED(_x) (_WSTATUS(_x) == 0) 12 /* Extract the pid from the status (Castor specific) */ 13 #define WGETPID(_x) ((pid_t)(_x >> 16)) 14 15 /* Flags to waitpid */ 16 #define WAIT_ANY 0 17 18 #ifndef _KERNEL 19 pid_t wait(int *status); 20 pid_t waitpid(pid_t pid, int *status, int options); 21 #endif 22 23 #endif /* __SYS_WAIT_H__ */ 24 25