diff options
Diffstat (limited to 'include/bits')
| -rw-r--r-- | include/bits/errno.h | 12 | ||||
| -rw-r--r-- | include/bits/sigevent.h | 2 | ||||
| -rw-r--r-- | include/bits/timespec.h | 2 | ||||
| -rw-r--r-- | include/bits/wait.h | 22 |
4 files changed, 38 insertions, 0 deletions
diff --git a/include/bits/errno.h b/include/bits/errno.h new file mode 100644 index 00000000..4789fef8 --- /dev/null +++ b/include/bits/errno.h @@ -0,0 +1,12 @@ +#ifndef __BITS_ERRNO_H +#define __BITS_ERRNO_H + +#ifndef __BITS_ERRNO_H_ +#error "Internal header — include the public API header instead." +#else +#undef __BITS_ERRNO_H_ +#endif + +typedef int errno_t; + +#endif diff --git a/include/bits/sigevent.h b/include/bits/sigevent.h index b36e676c..ddf4c4d7 100644 --- a/include/bits/sigevent.h +++ b/include/bits/sigevent.h @@ -3,6 +3,8 @@ #ifndef __BITS_SIGEVENT_H_ #error "Internal header — include the public API header instead." +#else +#undef __BITS_SIGEVENT_H_ #endif union sigval { diff --git a/include/bits/timespec.h b/include/bits/timespec.h index ebcacf76..646c76f7 100644 --- a/include/bits/timespec.h +++ b/include/bits/timespec.h @@ -3,6 +3,8 @@ #ifndef __BITS_TIMESPEC_H_ #error "Never include <bits/timespec.h> directly; use <time.h> instead." +#else +#undef __BITS_TIMESPEC_H_ #endif typedef __INT64_TYPE__ time_t; diff --git a/include/bits/wait.h b/include/bits/wait.h new file mode 100644 index 00000000..5e346276 --- /dev/null +++ b/include/bits/wait.h @@ -0,0 +1,22 @@ +#ifndef __BITS_WAIT_H +#define __BITS_WAIT_H + +#ifndef __BITS_WAIT_H_ +#error "Internal header — include the public API header instead." +#else +#undef __BITS_WAIT_H_ +#endif + +#define WNOHANG 0x00000001 +#define WUNTRACED 0x00000002 + +#define WEXITSTATUS(__status) (((__status) & 0xff00) >> 8) +#define WCOREDUMP(__status) ((__status) & 0x80) +#define WTERMSIG(__status) ((__status) & 0x7f) +#define WSTOPSIG(__status) WEXITSTATUS(__status) +#define WIFEXITED(__status) (WTERMSIG(__status) == 0) +#define WIFSTOPPED(__status) (((__status) & 0xff) == 0x7f) +#define WIFSIGNALED(__status) (((__status) & 0xffff) - 1U < 0xffu) +#define WSTOPSIG(__status) WEXITSTATUS(__status) + +#endif |
