fix x32 msghdr struct by removing x32 bits/socket.h
[musl.git] / include / sys / wait.h
blobd9adbdec827f17844839f3e0a3eab19136926722
1 #ifndef _SYS_WAIT_H
2 #define _SYS_WAIT_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
7 #include <features.h>
9 #define __NEED_pid_t
10 #define __NEED_id_t
11 #include <bits/alltypes.h>
13 typedef enum {
14 P_ALL = 0,
15 P_PID = 1,
16 P_PGID = 2
17 } idtype_t;
19 pid_t wait (int *);
20 pid_t waitpid (pid_t, int *, int );
22 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
23 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
24 || defined(_BSD_SOURCE)
25 #include <signal.h>
26 int waitid (idtype_t, id_t, siginfo_t *, int);
27 #endif
29 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
30 #include <sys/resource.h>
31 pid_t wait3 (int *, int, struct rusage *);
32 pid_t wait4 (pid_t, int *, int, struct rusage *);
33 #endif
35 #define WNOHANG 1
36 #define WUNTRACED 2
38 #define WSTOPPED 2
39 #define WEXITED 4
40 #define WCONTINUED 8
41 #define WNOWAIT 0x1000000
43 #define __WNOTHREAD 0x20000000
44 #define __WALL 0x40000000
45 #define __WCLONE 0x80000000
47 #define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
48 #define WTERMSIG(s) ((s) & 0x7f)
49 #define WSTOPSIG(s) WEXITSTATUS(s)
50 #define WCOREDUMP(s) ((s) & 0x80)
51 #define WIFEXITED(s) (!WTERMSIG(s))
52 #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
53 #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
54 #define WIFCONTINUED(s) ((s) == 0xffff)
56 #if _REDIR_TIME64
57 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
58 __REDIR(wait3, __wait3_time64);
59 __REDIR(wait4, __wait4_time64);
60 #endif
61 #endif
63 #ifdef __cplusplus
65 #endif
66 #endif