#include #include #include /* Wait for a process to change state */ pid_t wait(int *wstatus) { return waitpid(-1, wstatus, 0); } /* Wait for a specific process to change state */ pid_t waitpid(pid_t pid, int *wstatus, int options) { int ret; asm volatile("int $0x80" : "=a" (ret) : "0" (SYSCALL_WAITPID), "c" (3), "S" (&pid)); if (ret >= 0) return ret; errno = -ret; return -1; }