From fb3348128ebf333d31ab26fe3a65f78031492f82 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Mon, 2 Oct 2023 19:34:24 -0400 Subject: [PATCH] Add sys/wait.h --- sys/include/wait.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sys/include/wait.h diff --git a/sys/include/wait.h b/sys/include/wait.h new file mode 100644 index 0000000..8c1c6bf --- /dev/null +++ b/sys/include/wait.h @@ -0,0 +1,20 @@ + +#ifndef __SYS_WAIT_H__ +#define __SYS_WAIT_H__ + +#include + +/* Extract the status code from the process */ +#define WEXITSTATUS(_x) (_x & 0x000000ff) +#define WGETPID(_x) ((pid_t)(_x >> 16)) + +/* Flags to waitpid */ +#define WAIT_ANY 0 + +#ifndef _KERNEL +pid_t wait(int *status); +pid_t waitpid(pid_t pid, int *status, int options); +#endif + +#endif /* __SYS_WAIT_H__ */ +