1 #include <sys/signalfd.h>
7 int signalfd(int fd
, const sigset_t
*sigs
, int flags
)
9 int ret
= __syscall(SYS_signalfd4
, fd
, sigs
, _NSIG
/8, flags
);
11 if (ret
!= -ENOSYS
) return __syscall_ret(ret
);
12 ret
= __syscall(SYS_signalfd
, fd
, sigs
, _NSIG
/8);
14 if (flags
& SFD_CLOEXEC
)
15 __syscall(SYS_fcntl
, ret
, F_SETFD
, FD_CLOEXEC
);
16 if (flags
& SFD_NONBLOCK
)
17 __syscall(SYS_fcntl
, ret
, F_SETFL
, O_NONBLOCK
);
20 return __syscall_ret(ret
);