int waitfd(int which, pid_t upid, int options, int flags);
yields a pollable file descriptor which yields a 'struct siginfo_t' whenever
waitid() or waitpid() would return (when child processes die or ptrace()d
tracees undergo an appropriate state change).
The which, upid and options arguments are as to waitid(); the flags argument is
fd flags as to open() or fcntl(F_SETFL), to which O_RDWR is automatically added.
WNOHANG in the options is automatically translated into O_NONBLOCK in the flags,
and vice versa.
No compat wrappers are in place for this syscall: 32-bit calls with a 64-bit
kernel will return a 64-bit version of 'struct siginfo'.
Current bugs:
- select/poll/epoll is not waking up the process yet, even when it should.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>