overhaul cancellation to fix resource leaks and dangerous behavior with signals
[musl] / src / process / waitpid.c
1 #include <sys/wait.h>
2 #include "syscall.h"
3 #include "libc.h"
4
5 pid_t waitpid(pid_t pid, int *status, int options)
6 {
7         int r;
8         CANCELPT_BEGIN;
9         r = syscall(SYS_wait4, pid, status, options, 0);
10         if (r<0) CANCELPT_TRY;
11         CANCELPT_END;
12         return r;
13 }