LibC: add wait and waitpid

Note that wait() doesn't work since only waiting for specified
pid is supported. wait() will just return -1 and set errno to
ECHILD.
This commit is contained in:
Bananymous
2023-06-04 17:59:13 +03:00
parent 9fbb2b9369
commit 40055f023c
5 changed files with 26 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ __BEGIN_DECLS
#define SYS_SLEEP 14
#define SYS_EXEC 15
#define SYS_REALLOC 16
#define SYS_WAIT 17
__END_DECLS

View File

@@ -20,11 +20,12 @@ __BEGIN_DECLS
#define WNOWAIT 0x10
#define WSTOPPED 0x20
#define WEXITSTATUS(status) (status & 0xFF)
#define WIFEXITED(status) (WEXITSTATUS(status) != 0)
// FIXME
#if 0
#define WEXITSTATUS
#define WIFCONTINUED
#define WIFEXITED
#define WIFSIGNALED
#define WIFSTOPPED
#define WSTOPSIG