Files
MontaukOS/template/sysroot/include/libc/sys/wait.h
T

32 lines
673 B
C

#ifndef _LIBC_SYS_WAIT_H
#define _LIBC_SYS_WAIT_H
#pragma once
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* POSIX status decoding. waitpid() encodes a normal exit as code<<8
and a killed/crashed child as the signal number in the low bits. */
#define WIFEXITED(s) (((s) & 0x7F) == 0)
#define WEXITSTATUS(s) (((s) >> 8) & 0xFF)
#define WIFSIGNALED(s) (((s) & 0x7F) != 0)
#define WTERMSIG(s) ((s) & 0x7F)
#define WIFSTOPPED(s) (0)
#define WSTOPSIG(s) (0)
#define WNOHANG 1
#define WUNTRACED 2
pid_t wait(int *status);
pid_t waitpid(pid_t pid, int *status, int options);
#ifdef __cplusplus
}
#endif
#endif /* _LIBC_SYS_WAIT_H */