vfs: check userland buffers before reading them.
[haiku.git] / headers / posix / sys / wait.h
blob6b3217309b0371ff147639eaac2ceefedc67be07
1 /*
2 * Copyright 2004-2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _SYS_WAIT_H
6 #define _SYS_WAIT_H
9 #include <sys/types.h>
10 #include <signal.h>
13 /* waitpid()/waitid() options */
14 #define WNOHANG 0x01
15 #define WUNTRACED 0x02
16 #define WCONTINUED 0x04
17 #define WEXITED 0x08
18 #define WSTOPPED 0x10
19 #define WNOWAIT 0x20
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() */
32 typedef enum {
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 */
36 } idtype_t;
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
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);
47 #ifdef __cplusplus
49 #endif
51 #endif /* _SYS_WAIT_H */