summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-23 20:46:59 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:42 +0200
commit62c208d68fb07d85e42780394576b6b40aae7d53 (patch)
treec3ea8096678c8aea315396ac10b795bf666607b4 /libc/sysdeps/linux
parent95c40e9fafcba415cf50611f8dc7c425f078f376 (diff)
pause.c: add back usage of pause syscall
No idea why it was removed when NPTL was added, but glibc uses it as well. 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')
-rw-r--r--libc/sysdeps/linux/common/pause.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c
index 8a4d82177..32fe839c0 100644
--- a/libc/sysdeps/linux/common/pause.c
+++ b/libc/sysdeps/linux/common/pause.c
@@ -7,16 +7,24 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#define __need_NULL
-#include <stddef.h>
+#include <sys/syscall.h>
#include <unistd.h>
-#include <signal.h>
#include <cancel.h>
+#ifdef __NR_pause
+/* even if it is not obvious, glibc uses the pause syscall, see syscalls.list */
+# define __NR___pause_nocancel __NR_pause
+static _syscall0(int, __NC(pause))
+CANCELLABLE_SYSCALL(int, pause, (void), ())
+#else
+# define __need_NULL
+# include <stddef.h>
+# include <signal.h>
+
int
-#ifdef __LINUXTHREADS_OLD__
+# ifdef __LINUXTHREADS_OLD__
weak_function
-#endif
+# endif
pause(void)
{
sigset_t set;
@@ -30,3 +38,4 @@ pause(void)
}
lt_strong_alias(pause)
LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */
+#endif