]> granicus.if.org Git - strace/blob - eventfd.c
tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
[strace] / eventfd.c
1 /*
2  * Copyright (c) 2007 Ulrich Drepper <drepper@redhat.com>
3  * Copyright (c) 2008-2018 Dmitry V. Levin <ldv@altlinux.org>
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: LGPL-2.1-or-later
7  */
8
9 #include "defs.h"
10 #include <fcntl.h>
11 #ifdef HAVE_SYS_EVENTFD_H
12 # include <sys/eventfd.h>
13 #endif
14
15 #include "xlat/efd_flags.h"
16
17 static int
18 do_eventfd(struct tcb *tcp, int flags_arg)
19 {
20         tprintf("%u", (unsigned int) tcp->u_arg[0]);
21         if (flags_arg >= 0) {
22                 tprints(", ");
23                 printflags(efd_flags, tcp->u_arg[flags_arg], "EFD_???");
24         }
25
26         return RVAL_DECODED | RVAL_FD;
27 }
28
29 SYS_FUNC(eventfd)
30 {
31         return do_eventfd(tcp, -1);
32 }
33
34 SYS_FUNC(eventfd2)
35 {
36         return do_eventfd(tcp, 1);
37 }