]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for eventfd2 (and wire up pipe2 on PPC platforms).
authorTom Hughes <tom@compton.nu>
Wed, 10 Dec 2008 09:28:56 +0000 (09:28 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 10 Dec 2008 09:28:56 +0000 (09:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8815

coregrind/m_syswrap/priv_syswrap-linux.h
coregrind/m_syswrap/syswrap-amd64-linux.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-ppc64-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c

index 799d420e85e5f141e43d2de8baa5940a4798a5ba..e3e04ad5400fbe569ac73040722b2b505cf29ddb 100644 (file)
@@ -84,6 +84,7 @@ DECL_TEMPLATE(linux, sys_epoll_ctl);
 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);
index 24d2a8c5c5a2741219a96a0418626ed137239a13..a1b1da3703908ab9dd0531c26cc5bc1760c9789b 100644 (file)
@@ -1363,7 +1363,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
    //   (__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
index ac90ba756dca03a997896d77dee5168490d95c8a..acec29f3bf8653301d225e1046db7904affb16f7 100644 (file)
@@ -1111,6 +1111,22 @@ POST(sys_eventfd)
    }
 }
 
+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
    ------------------------------------------------------------------ */
index ee30ef9c6c8477556a8d0eb9a810f2830bd9b71f..fbd6a4361802046c11bf2ad821e8c72ce7914547 100644 (file)
@@ -1859,6 +1859,12 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 //   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) = 
index 8fce518a5ed5c31178fb577ee9c0da29b4aedb8f..58a5f1a3c921d851c3bf83980b912bd3d1c5497b 100644 (file)
@@ -1499,6 +1499,12 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 //   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) = 
index b4dd604abef59afd030687012ef53b131d910121..6fafabd2327835ff37d2b7f911a8e0f03e390dcd 100644 (file)
@@ -2235,7 +2235,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
    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