summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/ppoll.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-22 00:42:58 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:41 +0200
commit145ad1d976abff15f32e129e25f47c04807d24ac (patch)
tree46a8d5a463865e48f570833285ef28726c256b22 /libc/sysdeps/linux/common/ppoll.c
parentb72b0b14d0da0b506fbddf755cc8c7d0cd813287 (diff)
poll, ppoll: use cancel.h
use __SYSCALL_SIGSET_T_SIZE use non-cancellable select in fallback Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common/ppoll.c')
-rw-r--r--libc/sysdeps/linux/common/ppoll.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/libc/sysdeps/linux/common/ppoll.c b/libc/sysdeps/linux/common/ppoll.c
index 3ca3f7333..9135fe523 100644
--- a/libc/sysdeps/linux/common/ppoll.c
+++ b/libc/sysdeps/linux/common/ppoll.c
@@ -20,19 +20,16 @@
#include <sys/syscall.h>
#if defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
-# define __need_NULL
-# include <stddef.h>
-# include <signal.h>
-# include <sys/poll.h>
-# ifdef __UCLIBC_HAS_THREADS_NATIVE__
-# include <sysdep-cancel.h>
-# else
-# define SINGLE_THREAD_P 1
-# endif
-
-int
-ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
- const sigset_t *sigmask)
+
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <sys/poll.h>
+#include <cancel.h>
+
+static int
+__NC(ppoll)(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+ const sigset_t *sigmask)
{
/* The Linux kernel can in some situations update the timeout value.
We do not want that so use a local variable. */
@@ -41,14 +38,11 @@ ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
tval = *timeout;
timeout = &tval;
}
- if (SINGLE_THREAD_P)
- return INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
-
-# ifdef __UCLIBC_HAS_THREADS_NATIVE__
- int oldtype = LIBC_CANCEL_ASYNC ();
- int result = INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
- LIBC_CANCEL_RESET (oldtype);
- return result;
-# endif
+ return INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, __SYSCALL_SIGSET_T_SIZE);
}
+
+CANCELLABLE_SYSCALL(int, ppoll, (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+ const sigset_t *sigmask),
+ (fds, nfds, timeout, sigmask))
+
#endif