File epoll-wait-fix.patch of Package valgrind.7869

backport of https://bugs.kde.org/show_bug.cgi?id=381289
see https://bugzilla.suse.com/show_bug.cgi?id=1064958

--- coregrind/m_syswrap/syswrap-linux.c	(revision 16470)
+++ coregrind/m_syswrap/syswrap-linux.c	(working copy)
@@ -1901,7 +1901,7 @@ PRE(sys_epoll_pwait)
                  int, maxevents, int, timeout, vki_sigset_t *, sigmask,
                  vki_size_t, sigsetsize);
    PRE_MEM_WRITE( "epoll_pwait(events)", ARG2, sizeof(struct vki_epoll_event)*ARG3);
-   if (ARG4)
+   if (ARG5)
       PRE_MEM_READ( "epoll_pwait(sigmask)", ARG5, sizeof(vki_sigset_t) );
 }
 POST(sys_epoll_pwait)
Index: memcheck/tests/linux/syscalls-2007.c
===================================================================
--- memcheck/tests/linux/syscalls-2007.c	(revision 16470)
+++ memcheck/tests/linux/syscalls-2007.c	(working copy)
@@ -79,5 +79,16 @@ int main (void)
   }
 #endif
 
+#if defined(HAVE_EPOLL_CREATE) && defined(HAVE_EPOLL_PWAIT)
+  {
+    int fd3;
+    struct epoll_event evs[10];
+
+    fd3 = epoll_create (10);
+    /* epoll_pwait can take a NULL sigmask. */
+    epoll_pwait (fd3, evs, 10, 1, NULL);
+  }
+#endif
+
   return 0;
 }
openSUSE Build Service is sponsored by