diff options
Diffstat (limited to 'libc/sysdeps/linux/common/pause.c')
-rw-r--r-- | libc/sysdeps/linux/common/pause.c | 30 |
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) |