DECL_TEMPLATE(linux, sys_epoll_wait);
DECL_TEMPLATE(linux, sys_epoll_pwait);
DECL_TEMPLATE(linux, sys_eventfd);
+DECL_TEMPLATE(linux, sys_eventfd2);
DECL_TEMPLATE(linux, sys_gettid);
DECL_TEMPLATE(linux, sys_set_tid_address);
// (__NR_paccept, sys_ni_syscall) // 288
// (__NR_signalfd4, sys_ni_syscall) // 289
- // (__NR_eventfd2, sys_ni_syscall) // 290
+ LINX_(__NR_eventfd2, sys_eventfd2), // 290
// (__NR_epoll_create1, sys_ni_syscall) // 291
// (__NR_dup3, sys_ni_syscall) // 292
LINXY(__NR_pipe2, sys_pipe2) // 293
}
}
+PRE(sys_eventfd2)
+{
+ PRINT("sys_eventfd2 ( %lu, %d )", ARG1,ARG2);
+ PRE_REG_READ2(long, "sys_eventfd2", unsigned int, count, int, flags);
+}
+POST(sys_eventfd2)
+{
+ if (!ML_(fd_allowed)(RES, "eventfd2", tid, True)) {
+ VG_(close)(RES);
+ SET_STATUS_Failure( VKI_EMFILE );
+ } else {
+ if (VG_(clo_track_fds))
+ ML_(record_fd_open_nameless) (tid, RES);
+ }
+}
+
/* ---------------------------------------------------------------------
tid-related wrappers
------------------------------------------------------------------ */
// LINXY(__NR_subpage_prot, sys_ni_syscall), // 310
LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 311
LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 312
+ // (__NR_signalfd4, sys_ni_syscall) // 313
+ LINX_(__NR_eventfd2, sys_eventfd2), // 314
+ // (__NR_epoll_create1, sys_ni_syscall) // 315
+ // (__NR_dup3, sys_ni_syscall) // 316
+ LINXY(__NR_pipe2, sys_pipe2) // 317
+ // (__NR_inotify_init1, sys_ni_syscall) // 318
};
const UInt ML_(syscall_table_size) =
// LINXY(__NR_subpage_prot, sys_ni_syscall), // 310
LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 311
LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 312
+ // (__NR_signalfd4, sys_ni_syscall) // 313
+ LINX_(__NR_eventfd2, sys_eventfd2), // 314
+ // (__NR_epoll_create1, sys_ni_syscall) // 315
+ // (__NR_dup3, sys_ni_syscall) // 316
+ LINXY(__NR_pipe2, sys_pipe2) // 317
+ // (__NR_inotify_init1, sys_ni_syscall) // 318
};
const UInt ML_(syscall_table_size) =
LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 325
LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 326
// (__NR_signalfd4, sys_ni_syscall) // 327
- // (__NR_eventfd2, sys_ni_syscall) // 328
+ LINX_(__NR_eventfd2, sys_eventfd2), // 328
// (__NR_epoll_create1, sys_ni_syscall) // 329
// (__NR_dup3, sys_ni_syscall) // 330