Serenity Operating System
1/*
2 * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <Kernel/API/POSIX/sys/types.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define WEXITSTATUS(status) (((status)&0xff00) >> 8)
16#define WSTOPSIG(status) WEXITSTATUS(status)
17#define WTERMSIG(status) ((status)&0x7f)
18#define WIFEXITED(status) (WTERMSIG(status) == 0)
19#define WIFSTOPPED(status) (((status)&0xff) == 0x7f)
20#define WIFSIGNALED(status) (((char)(((status)&0x7f) + 1) >> 1) > 0)
21#define WIFCONTINUED(status) ((status) == 0xffff)
22
23#define WNOHANG 1
24#define WUNTRACED 2
25#define WSTOPPED WUNTRACED
26#define WEXITED 4
27#define WCONTINUED 8
28#define WNOWAIT 0x1000000
29
30typedef enum {
31 P_ALL = 1,
32 P_PID,
33 P_PGID
34} idtype_t;
35
36#ifdef __cplusplus
37}
38#endif