2 * Copyright 2004-2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
13 /* waitpid()/waitid() options */
15 #define WUNTRACED 0x02
16 #define WCONTINUED 0x04
21 /* macros to interprete wait()/waitpid() status */
22 #define WIFEXITED(value) (((value) & ~0xff) == 0)
23 #define WEXITSTATUS(value) ((value) & 0xff)
24 #define WIFSIGNALED(value) ((((value) >> 8) & 0xff) != 0)
25 #define WTERMSIG(value) (((value) >> 8) & 0xff)
26 #define WIFSTOPPED(value) ((((value) >> 16) & 0xff) != 0)
27 #define WSTOPSIG(value) (((value) >> 16) & 0xff)
28 #define WIFCORED(value) ((value) & 0x10000)
29 #define WIFCONTINUED(value) ((value) & 0x20000)
31 /* ID types for waitid() */
33 P_ALL
, /* wait for any children, ignore ID */
34 P_PID
, /* wait for the child whose process ID matches */
35 P_PGID
/* wait for any child whose process group ID matches */
43 extern pid_t
wait(int *_status
);
44 extern pid_t
waitpid(pid_t pid
, int *_status
, int options
);
45 extern int waitid(idtype_t idType
, id_t id
, siginfo_t
*info
, int options
);
51 #endif /* _SYS_WAIT_H */