]> granicus.if.org Git - strace/blob - eventfd.c
Robustify mpers.awk against invalid input
[strace] / eventfd.c
1 #include "defs.h"
2 #include <fcntl.h>
3 #ifdef HAVE_SYS_EVENTFD_H
4 # include <sys/eventfd.h>
5 #endif
6
7 #include "xlat/efd_flags.h"
8
9 static int
10 do_eventfd(struct tcb *tcp, int flags_arg)
11 {
12         tprintf("%u", (unsigned int) tcp->u_arg[0]);
13         if (flags_arg >= 0) {
14                 tprints(", ");
15                 printflags(efd_flags, tcp->u_arg[flags_arg], "EFD_???");
16         }
17
18         return RVAL_DECODED | RVAL_FD;
19 }
20
21 SYS_FUNC(eventfd)
22 {
23         return do_eventfd(tcp, -1);
24 }
25
26 SYS_FUNC(eventfd2)
27 {
28         return do_eventfd(tcp, 1);
29 }