summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/pause.c
diff options
context:
space:
mode:
authorKhem Raj <kraj@mvista.com>2008-07-09 23:52:41 +0000
committerKhem Raj <kraj@mvista.com>2008-07-09 23:52:41 +0000
commitc776700c71250f0666f5f23ba198f6c3d03974c6 (patch)
treeedf45e8c27e0704a51e22be1f37f06e2e0a3e09e /libc/sysdeps/linux/common/pause.c
parent8881017aeb43889e5eba0bd29e7bd484b715f56b (diff)
downloaduClibc-alpine-c776700c71250f0666f5f23ba198f6c3d03974c6.tar.bz2
uClibc-alpine-c776700c71250f0666f5f23ba198f6c3d03974c6.tar.xz
Fix the builds without STDIO_FUTEXES. Fix msgecv and msgsend to compile on ARM as well.
Diffstat (limited to 'libc/sysdeps/linux/common/pause.c')
-rw-r--r--libc/sysdeps/linux/common/pause.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c
index 31d3563fb..22a039b4f 100644
--- a/libc/sysdeps/linux/common/pause.c
+++ b/libc/sysdeps/linux/common/pause.c
@@ -10,23 +10,19 @@
#define __UCLIBC_HIDE_DEPRECATED__
#include <sys/syscall.h>
#include <unistd.h>
-#include <sysdep-cancel.h>
-/* Suspend the process until a signal arrives.
- This always returns -1 and sets errno to EINTR. */
-int
-__libc_pause (void)
-{
- sigset_t set;
-
- __sigemptyset (&set);
- sigprocmask (SIG_BLOCK, NULL, &set);
-
- /* pause is a cancellation point, but so is sigsuspend.
- So no need for anything special here. */
+extern __typeof(pause) __libc_pause;
+#ifdef __NR_pause
+#define __NR___libc_pause __NR_pause
+_syscall0(int, __libc_pause);
+#else
+#include <signal.h>
+libc_hidden_proto(__sigpause)
+libc_hidden_proto(sigblock)
- return sigsuspend (&set);
+int __libc_pause(void)
+{
+ return (__sigpause(sigblock(0), 0));
}
-weak_alias (__libc_pause, pause)
-
-LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */
+#endif
+weak_alias(__libc_pause,pause)