1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:57:45 +00:00

Kernel+LibC: Share definitions for sys/wait.h

This commit is contained in:
Andreas Kling 2021-08-14 18:18:30 +02:00
parent 661bd992b0
commit 6f78377864
3 changed files with 40 additions and 36 deletions

View file

@ -6,32 +6,11 @@
#pragma once
#include <signal.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <Kernel/API/POSIX/signal.h>
#include <Kernel/API/POSIX/sys/wait.h>
__BEGIN_DECLS
#define WEXITSTATUS(status) (((status)&0xff00) >> 8)
#define WSTOPSIG(status) WEXITSTATUS(status)
#define WTERMSIG(status) ((status)&0x7f)
#define WIFEXITED(status) (WTERMSIG(status) == 0)
#define WIFSTOPPED(status) (((status)&0xff) == 0x7f)
#define WIFSIGNALED(status) (((char)(((status)&0x7f) + 1) >> 1) > 0)
#define WNOHANG 1
#define WUNTRACED 2
#define WSTOPPED WUNTRACED
#define WEXITED 4
#define WCONTINUED 8
#define WNOWAIT 0x1000000
typedef enum {
P_ALL = 1,
P_PID,
P_PGID
} idtype_t;
pid_t waitpid(pid_t, int* wstatus, int options);
pid_t wait(int* wstatus);
int waitid(idtype_t idtype, id_t id, siginfo_t* infop, int options);