etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / wait4.c
blob4f9024d9c93fdc02c4adb69d943178c93249e466
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
5 #include <string.h>
6 #include <sys/wait.h>
8 #ifdef __weak_alias
9 __weak_alias(wait4, __wait450)
10 #endif
12 pid_t
13 wait4(pid_t pid, int * status, int options, struct rusage * rusage)
15 message m;
17 memset(&m, 0, sizeof(m));
18 m.m_lc_pm_wait4.pid = pid;
19 m.m_lc_pm_wait4.options = options;
20 m.m_lc_pm_wait4.addr = (vir_bytes)rusage;
22 if (_syscall(PM_PROC_NR, PM_WAIT4, &m) < 0) return(-1);
24 if (status != NULL) *status = m.m_pm_lc_wait4.status;
25 return m.m_type;