* configure.ac (AC_CHECK_FUNCS): Add eventfd.
(AC_CHECK_HEADERS): Add sys/signalfd.h.
* signalfd.c: Include <fcntl.h>.
[HAVE_SYS_SIGNALFD_H] Include <sys/signalfd.h>.
Include "xlat/sfd_flags.h".
(do_signalfd): Use sfd_flags for flags decoding.
* xlat/sfd_flags.in: New file.
* tests/signalfd.c: Likewise.
* tests/signalfd.expected: Likewise.
* tests/signalfd.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add signalfd.
(TESTS): Add signalfd.test.
(EXTRA_DIST): Add signalfd.expected.
* tests/.gitignore: Add signalfd.
sendmsg
sendmmsg
sigaction
+ signalfd
stpcpy
strerror
strsignal
sys/fanotify.h
sys/ioctl.h
sys/reg.h
+ sys/signalfd.h
sys/vfs.h
sys/xattr.h
]))
#include "defs.h"
+#include <fcntl.h>
+#ifdef HAVE_SYS_SIGNALFD_H
+# include <sys/signalfd.h>
+#endif
+
+#include "xlat/sfd_flags.h"
static int
do_signalfd(struct tcb *tcp, int flags_arg)
tprintf(", %lu", tcp->u_arg[2]);
if (flags_arg >= 0) {
tprints(", ");
- printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
+ printflags(sfd_flags, tcp->u_arg[flags_arg], "SFD_???");
}
return RVAL_DECODED | RVAL_FD;
set_ptracer_any
sigaction
sigaltstack
+signalfd
sigreturn
stack-fcall
stat
set_ptracer_any \
sigaction \
sigaltstack \
+ signalfd \
sigreturn \
stack-fcall \
stat \
select.test \
sigaction.test \
sigaltstack.test \
+ signalfd.test \
sigreturn.test \
stat.test \
stat32-v.test \
select.awk \
sigaction.awk \
sigaltstack.expected \
+ signalfd.expected \
statfs.expected \
sun_path.expected \
uid.awk \
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <signal.h>
+#include <unistd.h>
+#ifdef HAVE_SYS_SIGNALFD_H
+# include <sys/signalfd.h>
+#endif
+
+int
+main(void)
+{
+#if defined HAVE_SYS_SIGNALFD_H && defined HAVE_SIGNALFD
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR2);
+ sigaddset(&mask, SIGCHLD);
+ (void) close(0);
+ return signalfd(-1, &mask, O_CLOEXEC | O_NONBLOCK) == 0 ?
+ 0 : 77;
+#else
+ return 77;
+#endif
+}
--- /dev/null
+signalfd4\(-1, \[(USR2 CHLD|CHLD USR2)\], (4|8|16), SFD_CLOEXEC\|SFD_NONBLOCK\) += 0
--- /dev/null
+#!/bin/sh
+
+# Check signalfd4 syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+run_prog
+run_strace -e signalfd4 $args
+match_grep
+
+exit 0
--- /dev/null
+SFD_CLOEXEC O_CLOEXEC
+SFD_NONBLOCK O_NONBLOCK