瀏覽代碼

fix ppoll. we forgot to pass 5th parameter to the syscall

Denis Vlasenko 16 年之前
父節點
當前提交
f82635e74a
共有 1 個文件被更改,包括 17 次插入14 次删除
  1. 17 14
      libc/sysdeps/linux/common/ppoll.c

+ 17 - 14
libc/sysdeps/linux/common/ppoll.c

@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
+#include <signal.h>
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 #include <sys/poll.h>
 #include <sys/poll.h>
 
 
@@ -26,24 +27,26 @@
 
 
 # define __NR___libc_ppoll __NR_ppoll
 # define __NR___libc_ppoll __NR_ppoll
 static __always_inline
 static __always_inline
-_syscall4(int, __libc_ppoll, struct pollfd *, fds,
+_syscall5(int, __libc_ppoll,
-	nfds_t, nfds, const struct timespec *, timeout,
+	struct pollfd *, fds,
-	const __sigset_t *, sigmask)
+	nfds_t, nfds,
+	const struct timespec *, timeout,
+	const __sigset_t *, sigmask,
+	size_t, sigsetsize)
 
 
 int
 int
-ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
        const __sigset_t *sigmask)
        const __sigset_t *sigmask)
 {
 {
-  /* The Linux kernel can in some situations update the timeout value.
+	/* The Linux kernel can in some situations update the timeout value.
-     We do not want that so use a local variable.  */
+	   We do not want that so use a local variable.  */
-  struct timespec tval;
+	struct timespec tval;
-  if (timeout != NULL)
+	if (timeout != NULL) {
-    {
+		tval = *timeout;
-      tval = *timeout;
+		timeout = &tval;
-      timeout = &tval;
+	}
-    }
+
-
+	return __libc_ppoll(fds, nfds, timeout, sigmask, _NSIG / 8);
-  return __libc_ppoll(fds, nfds, timeout, sigmask);
 }
 }
 libc_hidden_def(ppoll)
 libc_hidden_def(ppoll)