diff options
| author | Jakob Kaivo <jkk@ung.org> | 2024-01-31 16:46:49 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2024-01-31 16:46:49 -0500 |
| commit | cb7967b40d4a9b6e17003b8518c7cd49d29108ab (patch) | |
| tree | 5b4c7cbe991ae5ddee64afc152150dc1b739be8d /src/sys/wait/waitpid.c | |
| parent | 2bc46bd54cc8cdcd7647461f2d76384266f2a0e4 (diff) | |
purge last of posix-specific headers
Diffstat (limited to 'src/sys/wait/waitpid.c')
| -rw-r--r-- | src/sys/wait/waitpid.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/sys/wait/waitpid.c b/src/sys/wait/waitpid.c deleted file mode 100644 index 001cc2f6..00000000 --- a/src/sys/wait/waitpid.c +++ /dev/null @@ -1,45 +0,0 @@ -#include <sys/types.h> -#include <sys/wait.h> -#include <signal.h> -#include <unistd.h> -#include "_syscall.h" - -#ifndef P_PID -#include "signal/union_sigval.h" -#include "signal/siginfo_t.h" -#include "idtype_t.h" -#include "P_PID.h" -#include "P_PGID.h" -#include "P_ALL.h" -#define getpgid(_pid) __syscall(__syscall_lookup(getpgid), _pid, 0, 0, 0, 0, 0) -#define waitid(_type, _id, _si, _opt) __syscall(__syscall_lookup(waitid), _type, _id, _si, _opt, 0, 0) -#endif - -pid_t waitpid(pid_t pid, int *stat_loc, int options) -{ - /* TODO: handle WUNTRACED, is not recognized by waitid() */ - - siginfo_t si = { 0 }; - idtype_t idt = P_PID; - int ret = -1; - - if (pid == (pid_t)-1) { - idt = P_ALL; - } else if (pid == 0) { - idt = P_PGID; - pid = getpgid(0); - } else if (pid < (pid_t)-1) { - idt = P_PGID; - pid = -pid; - } - - ret = waitid(idt, pid, &si, options); - if (stat_loc) { - *stat_loc = si.si_status; - } - return ret; -} - -/* -POSIX(1) -*/ |
