2007-07-23  Ulrich Drepper  <drepper@redhat.com>

	* desc.c (sys_epoll_wait): Move body of function to ...
	(epoll_wait_common): ...here.  New function.
	(sys_epoll_pwait): New function.
	* linux/syscall.h: Declare sys_epoll_pwait.
	* linux/syscallent.h: Add entry for epoll_pwait.
	* linux/x86_64/syscallent.h: Likewise.
diff --git a/desc.c b/desc.c
index 31af6c1..9c26b63 100644
--- a/desc.c
+++ b/desc.c
@@ -669,8 +669,8 @@
 	return 0;
 }
 
-int
-sys_epoll_wait(tcp)
+static void
+epoll_wait_common(tcp)
 struct tcb *tcp;
 {
 	if (entering(tcp))
@@ -708,6 +708,23 @@
 		}
 		tprintf(", %ld, %ld", tcp->u_arg[2], tcp->u_arg[3]);
 	}
+}
+
+int
+sys_epoll_wait(tcp)
+struct tcb *tcp;
+{
+	epoll_wait_common(tcp);
+	return 0;
+}
+
+int
+sys_epoll_pwait(tcp)
+struct tcb *tcp;
+{
+	epoll_wait_common(tcp);
+	if (exiting(tcp))
+		print_sigset(tcp, tcp->u_arg[4], 0);
 	return 0;
 }