From 08d6eb46caf13f46ce052d2be34522068c5a6d33 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 21 Aug 2017 17:23:56 -0300 Subject: Consolidate non cancellable pause call This patch consolidates all the non cancellable pause calls to use the __pause_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * nptl/pthread_mutex_lock.c (__pthread_mutex_lock_full): Replace pause_not_cancel with __pause_nocancel. * sysdeps/generic/not-cancel.h (pause_not_cancel): Remove macro. (__pause_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): Remove macro. (__pause_nocancel): New prototype. * sysdeps/unix/sysv/linux/pause.c (__pause_nocancel): New function. --- sysdeps/unix/sysv/linux/pause.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/pause.c') diff --git a/sysdeps/unix/sysv/linux/pause.c b/sysdeps/unix/sysv/linux/pause.c index 4ccce9ebd8..3300eb8b07 100644 --- a/sysdeps/unix/sysv/linux/pause.c +++ b/sysdeps/unix/sysv/linux/pause.c @@ -19,10 +19,10 @@ #include #include #include +#include /* Suspend the process until a signal arrives. This always returns -1 and sets errno to EINTR. */ - int __libc_pause (void) { @@ -33,3 +33,14 @@ __libc_pause (void) #endif } weak_alias (__libc_pause, pause) + +int +__pause_nocancel (void) +{ +#ifdef __NR_pause + return INLINE_SYSCALL_CALL (pause); +#else + return INLINE_SYSCALL_CALL (ppoll, NULL, 0, NULL, NULL); +#endif +} +libc_hidden_def (__pause_nocancel) -- cgit 1.4.1