Dmitry V. Levin | 28471d1 | 2015-08-01 20:36:53 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | static int |
| 4 | do_eventfd(struct tcb *tcp, int flags_arg) |
| 5 | { |
Dmitry V. Levin | 00cc350 | 2015-08-01 20:43:51 +0000 | [diff] [blame^] | 6 | tprintf("%u", (unsigned int) tcp->u_arg[0]); |
Dmitry V. Levin | 28471d1 | 2015-08-01 20:36:53 +0000 | [diff] [blame] | 7 | if (flags_arg >= 0) { |
| 8 | tprints(", "); |
| 9 | printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); |
| 10 | } |
| 11 | |
Dmitry V. Levin | ede0c48 | 2015-08-01 20:39:48 +0000 | [diff] [blame] | 12 | return RVAL_DECODED | RVAL_FD; |
Dmitry V. Levin | 28471d1 | 2015-08-01 20:36:53 +0000 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | SYS_FUNC(eventfd) |
| 16 | { |
| 17 | return do_eventfd(tcp, -1); |
| 18 | } |
| 19 | |
| 20 | SYS_FUNC(eventfd2) |
| 21 | { |
| 22 | return do_eventfd(tcp, 1); |
| 23 | } |