diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-30 15:12:09 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-30 15:12:09 +0200 |
commit | 07c3cc01ec530c862f62f1d3f11b5bb5e0e2076c (patch) | |
tree | 25c44136b006ef8b9c1822758678155b7c887d5f /LibC | |
parent | ed58abb9116eaa170ed59aad5b703a0b6a8cccf5 (diff) | |
download | serenity-07c3cc01ec530c862f62f1d3f11b5bb5e0e2076c.zip |
LibC: Move wait-related stuff to <sys/wait.h>. #POSIX
Diffstat (limited to 'LibC')
-rw-r--r-- | LibC/stdlib.cpp | 25 | ||||
-rw-r--r-- | LibC/sys/wait.h | 10 | ||||
-rw-r--r-- | LibC/unistd.h | 5 |
3 files changed, 23 insertions, 17 deletions
diff --git a/LibC/stdlib.cpp b/LibC/stdlib.cpp index 74d7d07939..3f4b64329c 100644 --- a/LibC/stdlib.cpp +++ b/LibC/stdlib.cpp @@ -1,19 +1,20 @@ -#include <stdlib.h> -#include <sys/mman.h> -#include <stdio.h> -#include <unistd.h> -#include <string.h> +#include <AK/AKString.h> +#include <AK/Assertions.h> +#include <AK/HashMap.h> +#include <AK/StdLibExtras.h> +#include <AK/Types.h> +#include <Kernel/Syscall.h> #include <alloca.h> #include <assert.h> -#include <errno.h> #include <ctype.h> +#include <errno.h> #include <signal.h> -#include <AK/Assertions.h> -#include <AK/Types.h> -#include <Kernel/Syscall.h> -#include <AK/StdLibExtras.h> -#include <AK/HashMap.h> -#include <AK/AKString.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/mman.h> +#include <sys/wait.h> +#include <unistd.h> extern "C" { diff --git a/LibC/sys/wait.h b/LibC/sys/wait.h index c9d9e960aa..3fedd42b2c 100644 --- a/LibC/sys/wait.h +++ b/LibC/sys/wait.h @@ -5,7 +5,17 @@ __BEGIN_DECLS +#define WEXITSTATUS(status) (((status)&0xff00) >> 8) +#define WTERMSIG(status) ((status)&0x7f) +#define WIFEXITED(status) (WTERMSIG(status) == 0) +#define WIFSIGNALED(status) (((char)(((status)&0x7f) + 1) >> 1) > 0) + #define WNOHANG 1 +#define WUNTRACED 2 +#define WSTOPPED WUNTRACED +#define WEXITED 4 +#define WCONTINUED 8 + pid_t wait(int* wstatus); __END_DECLS diff --git a/LibC/unistd.h b/LibC/unistd.h index 0ea910c299..a935330a6d 100644 --- a/LibC/unistd.h +++ b/LibC/unistd.h @@ -95,11 +95,6 @@ enum _PC_NAME_MAX, }; -#define WEXITSTATUS(status) (((status)&0xff00) >> 8) -#define WTERMSIG(status) ((status)&0x7f) -#define WIFEXITED(status) (WTERMSIG(status) == 0) -#define WIFSIGNALED(status) (((char)(((status)&0x7f) + 1) >> 1) > 0) - #define HOST_NAME_MAX 64 #define R_OK 4 |