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:
@@ -21,6 +21,7 @@ __BEGIN_DECLS
|
||||
#define SYS_SLEEP 14
|
||||
#define SYS_EXEC 15
|
||||
#define SYS_REALLOC 16
|
||||
#define SYS_WAIT 17
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user