mirror of
https://sourceware.org/git/glibc.git
synced 2026-10-24 01:33:52 +03:00
Consolidate non cancellable nanosleep call
This patch consolidates all the non cancellable nanosleep calls to use the __nanosleep_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_timedlock.c (__pthread_mutex_timedlock): Replace nanosleep_not_cancel with __nanosleep_nocancel. * sysdeps/generic/not-cancel.h (nanosleep_not_cancel): Remove macro. (__nanosleep_nocancel): New macro. * sysdeps/unix/sysv/linux/nanosleep.c (__nanosleep_nocancel): New function. * sysdeps/unix/sysv/linux/not-cancel.h (nanosleep_not_cancel): Remove macro. (__nanosleep_nocancel): New prototype.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <time.h>
|
||||
#include <sysdep-cancel.h>
|
||||
#include <not-cancel.h>
|
||||
|
||||
/* Pause execution for a number of nanoseconds. */
|
||||
int
|
||||
@@ -28,3 +29,11 @@ __nanosleep (const struct timespec *requested_time,
|
||||
}
|
||||
hidden_def (__nanosleep)
|
||||
weak_alias (__nanosleep, nanosleep)
|
||||
|
||||
int
|
||||
__nanosleep_nocancel (const struct timespec *requested_time,
|
||||
struct timespec *remaining)
|
||||
{
|
||||
return INLINE_SYSCALL_CALL (nanosleep, requested_time, remaining);
|
||||
}
|
||||
hidden_def (__nanosleep_nocancel)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
|
||||
/* Non cancellable open syscall. */
|
||||
__typeof (open) __open_nocancel;
|
||||
@@ -81,8 +82,8 @@ __typeof (pause) __pause_nocancel;
|
||||
libc_hidden_proto (__pause_nocancel)
|
||||
|
||||
/* Uncancelable nanosleep. */
|
||||
#define nanosleep_not_cancel(requested_time, remaining) \
|
||||
INLINE_SYSCALL (nanosleep, 2, requested_time, remaining)
|
||||
__typeof (__nanosleep) __nanosleep_nocancel;
|
||||
hidden_proto (__nanosleep_nocancel)
|
||||
|
||||
/* Uncancelable sigsuspend. */
|
||||
#define sigsuspend_not_cancel(set) \
|
||||
|
||||
Reference in New Issue
Block a user