blob: ec606cb25294e2df88062bdba09f27680e522112 [file] [log] [blame]
Dmitry V. Levin28471d12015-08-01 20:36:53 +00001#include "defs.h"
2
3static int
4do_eventfd(struct tcb *tcp, int flags_arg)
5{
6 tprintf("%lu", tcp->u_arg[0]);
7 if (flags_arg >= 0) {
8 tprints(", ");
9 printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
10 }
11
Dmitry V. Levinede0c482015-08-01 20:39:48 +000012 return RVAL_DECODED | RVAL_FD;
Dmitry V. Levin28471d12015-08-01 20:36:53 +000013}
14
15SYS_FUNC(eventfd)
16{
17 return do_eventfd(tcp, -1);
18}
19
20SYS_FUNC(eventfd2)
21{
22 return do_eventfd(tcp, 1);
23}