nptl: Move nanosleep implementation to libc

Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.  I also checked
the libpthread.so .gnu.version_d entries for every ABI affected and
all of them contains the required versions (including for architectures
which exports __nanosleep with a different version).

Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Adhemerval Zanella 2019-11-05 19:59:36 +00:00
parent 2a0356e119
commit 79a547b162
31 changed files with 5 additions and 60 deletions

View File

@ -44,7 +44,7 @@ pthread-compat-wrappers = \
write read close accept \
connect recv recvfrom send \
sendto fsync lseek lseek64 \
msync nanosleep open open64 pause \
msync open open64 pause \
pread pread64 pwrite pwrite64 \
tcdrain wait waitpid msgrcv msgsnd \
sigwait sigsuspend \
@ -225,7 +225,6 @@ CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sigsuspend.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables

View File

@ -98,7 +98,7 @@ libpthread {
# Cancellation points.
close; __close; fcntl; __fcntl; read; __read; write; __write; accept;
connect; __connect; recv; recvfrom; recvmsg; send; __send; sendmsg; sendto;
fsync; lseek; __lseek; msync; nanosleep; open; __open; pause; tcdrain;
fsync; lseek; __lseek; msync; open; __open; pause; tcdrain;
system; wait; __wait; waitpid;
# Hidden entry point (through macros).
@ -193,8 +193,7 @@ libpthread {
}
GLIBC_2.2.6 {
# Cancellation wrapper
__nanosleep;
__libpthread_version_placeholder;
}
GLIBC_2.3.2 {

View File

@ -26,7 +26,7 @@
version or later, the placeholder symbol is not needed because
there are plenty of other symbols which populate those later
versions. */
#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2_6))
void
attribute_compat_text_section
__libpthread_version_placeholder (void)

View File

@ -11,7 +11,6 @@ GLIBC_2.17 __libc_allocate_rtsig F
GLIBC_2.17 __libc_current_sigrtmax F
GLIBC_2.17 __libc_current_sigrtmin F
GLIBC_2.17 __lseek F
GLIBC_2.17 __nanosleep F
GLIBC_2.17 __open F
GLIBC_2.17 __open64 F
GLIBC_2.17 __pread64 F
@ -64,7 +63,6 @@ GLIBC_2.17 longjmp F
GLIBC_2.17 lseek F
GLIBC_2.17 lseek64 F
GLIBC_2.17 msync F
GLIBC_2.17 nanosleep F
GLIBC_2.17 open F
GLIBC_2.17 open64 F
GLIBC_2.17 pause F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -193,7 +192,6 @@ GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -46,7 +46,6 @@ GLIBC_2.4 __libc_allocate_rtsig F
GLIBC_2.4 __libc_current_sigrtmax F
GLIBC_2.4 __libc_current_sigrtmin F
GLIBC_2.4 __lseek F
GLIBC_2.4 __nanosleep F
GLIBC_2.4 __open F
GLIBC_2.4 __open64 F
GLIBC_2.4 __pread64 F
@ -99,7 +98,6 @@ GLIBC_2.4 longjmp F
GLIBC_2.4 lseek F
GLIBC_2.4 lseek64 F
GLIBC_2.4 msync F
GLIBC_2.4 nanosleep F
GLIBC_2.4 open F
GLIBC_2.4 open64 F
GLIBC_2.4 pause F

View File

@ -46,7 +46,6 @@ GLIBC_2.4 __libc_allocate_rtsig F
GLIBC_2.4 __libc_current_sigrtmax F
GLIBC_2.4 __libc_current_sigrtmin F
GLIBC_2.4 __lseek F
GLIBC_2.4 __nanosleep F
GLIBC_2.4 __open F
GLIBC_2.4 __open64 F
GLIBC_2.4 __pread64 F
@ -99,7 +98,6 @@ GLIBC_2.4 longjmp F
GLIBC_2.4 lseek F
GLIBC_2.4 lseek64 F
GLIBC_2.4 msync F
GLIBC_2.4 nanosleep F
GLIBC_2.4 open F
GLIBC_2.4 open64 F
GLIBC_2.4 pause F

View File

@ -9,7 +9,6 @@ GLIBC_2.29 __libc_allocate_rtsig F
GLIBC_2.29 __libc_current_sigrtmax F
GLIBC_2.29 __libc_current_sigrtmin F
GLIBC_2.29 __lseek F
GLIBC_2.29 __nanosleep F
GLIBC_2.29 __open F
GLIBC_2.29 __open64 F
GLIBC_2.29 __pread64 F
@ -72,7 +71,6 @@ GLIBC_2.29 mtx_lock F
GLIBC_2.29 mtx_timedlock F
GLIBC_2.29 mtx_trylock F
GLIBC_2.29 mtx_unlock F
GLIBC_2.29 nanosleep F
GLIBC_2.29 open F
GLIBC_2.29 open64 F
GLIBC_2.29 pause F

View File

@ -65,7 +65,6 @@ GLIBC_2.2 longjmp F
GLIBC_2.2 lseek F
GLIBC_2.2 lseek64 F
GLIBC_2.2 msync F
GLIBC_2.2 nanosleep F
GLIBC_2.2 open F
GLIBC_2.2 open64 F
GLIBC_2.2 pause F
@ -185,7 +184,6 @@ GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -193,7 +192,6 @@ GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -65,7 +65,6 @@ GLIBC_2.2 longjmp F
GLIBC_2.2 lseek F
GLIBC_2.2 lseek64 F
GLIBC_2.2 msync F
GLIBC_2.2 nanosleep F
GLIBC_2.2 open F
GLIBC_2.2 open64 F
GLIBC_2.2 pause F
@ -185,7 +184,6 @@ GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -46,7 +46,6 @@ GLIBC_2.4 __libc_allocate_rtsig F
GLIBC_2.4 __libc_current_sigrtmax F
GLIBC_2.4 __libc_current_sigrtmin F
GLIBC_2.4 __lseek F
GLIBC_2.4 __nanosleep F
GLIBC_2.4 __open F
GLIBC_2.4 __open64 F
GLIBC_2.4 __pread64 F
@ -99,7 +98,6 @@ GLIBC_2.4 longjmp F
GLIBC_2.4 lseek F
GLIBC_2.4 lseek64 F
GLIBC_2.4 msync F
GLIBC_2.4 nanosleep F
GLIBC_2.4 open F
GLIBC_2.4 open64 F
GLIBC_2.4 pause F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -193,7 +192,6 @@ GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -11,7 +11,6 @@ GLIBC_2.18 __libc_allocate_rtsig F
GLIBC_2.18 __libc_current_sigrtmax F
GLIBC_2.18 __libc_current_sigrtmin F
GLIBC_2.18 __lseek F
GLIBC_2.18 __nanosleep F
GLIBC_2.18 __open F
GLIBC_2.18 __open64 F
GLIBC_2.18 __pread64 F
@ -64,7 +63,6 @@ GLIBC_2.18 longjmp F
GLIBC_2.18 lseek F
GLIBC_2.18 lseek64 F
GLIBC_2.18 msync F
GLIBC_2.18 nanosleep F
GLIBC_2.18 open F
GLIBC_2.18 open64 F
GLIBC_2.18 pause F

View File

@ -11,7 +11,6 @@ GLIBC_2.18 __libc_allocate_rtsig F
GLIBC_2.18 __libc_current_sigrtmax F
GLIBC_2.18 __libc_current_sigrtmin F
GLIBC_2.18 __lseek F
GLIBC_2.18 __nanosleep F
GLIBC_2.18 __open F
GLIBC_2.18 __open64 F
GLIBC_2.18 __pread64 F
@ -64,7 +63,6 @@ GLIBC_2.18 longjmp F
GLIBC_2.18 lseek F
GLIBC_2.18 lseek64 F
GLIBC_2.18 msync F
GLIBC_2.18 nanosleep F
GLIBC_2.18 open F
GLIBC_2.18 open64 F
GLIBC_2.18 pause F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -192,7 +191,6 @@ GLIBC_2.2 sem_trywait F
GLIBC_2.2 sem_unlink F
GLIBC_2.2 sem_wait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -192,7 +191,6 @@ GLIBC_2.2 sem_trywait F
GLIBC_2.2 sem_unlink F
GLIBC_2.2 sem_wait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -11,7 +11,6 @@ GLIBC_2.21 __libc_allocate_rtsig F
GLIBC_2.21 __libc_current_sigrtmax F
GLIBC_2.21 __libc_current_sigrtmin F
GLIBC_2.21 __lseek F
GLIBC_2.21 __nanosleep F
GLIBC_2.21 __open F
GLIBC_2.21 __open64 F
GLIBC_2.21 __pread64 F
@ -64,7 +63,6 @@ GLIBC_2.21 longjmp F
GLIBC_2.21 lseek F
GLIBC_2.21 lseek64 F
GLIBC_2.21 msync F
GLIBC_2.21 nanosleep F
GLIBC_2.21 open F
GLIBC_2.21 open64 F
GLIBC_2.21 pause F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -193,7 +192,6 @@ GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -40,7 +40,6 @@ GLIBC_2.3 __libc_allocate_rtsig F
GLIBC_2.3 __libc_current_sigrtmax F
GLIBC_2.3 __libc_current_sigrtmin F
GLIBC_2.3 __lseek F
GLIBC_2.3 __nanosleep F
GLIBC_2.3 __open F
GLIBC_2.3 __open64 F
GLIBC_2.3 __pread64 F
@ -87,7 +86,6 @@ GLIBC_2.3 longjmp F
GLIBC_2.3 lseek F
GLIBC_2.3 lseek64 F
GLIBC_2.3 msync F
GLIBC_2.3 nanosleep F
GLIBC_2.3 open F
GLIBC_2.3 open64 F
GLIBC_2.3 pause F

View File

@ -11,7 +11,6 @@ GLIBC_2.17 __libc_allocate_rtsig F
GLIBC_2.17 __libc_current_sigrtmax F
GLIBC_2.17 __libc_current_sigrtmin F
GLIBC_2.17 __lseek F
GLIBC_2.17 __nanosleep F
GLIBC_2.17 __open F
GLIBC_2.17 __open64 F
GLIBC_2.17 __pread64 F
@ -64,7 +63,6 @@ GLIBC_2.17 longjmp F
GLIBC_2.17 lseek F
GLIBC_2.17 lseek64 F
GLIBC_2.17 msync F
GLIBC_2.17 nanosleep F
GLIBC_2.17 open F
GLIBC_2.17 open64 F
GLIBC_2.17 pause F

View File

@ -10,7 +10,6 @@ GLIBC_2.27 __libc_allocate_rtsig F
GLIBC_2.27 __libc_current_sigrtmax F
GLIBC_2.27 __libc_current_sigrtmin F
GLIBC_2.27 __lseek F
GLIBC_2.27 __nanosleep F
GLIBC_2.27 __open F
GLIBC_2.27 __open64 F
GLIBC_2.27 __pread64 F
@ -61,7 +60,6 @@ GLIBC_2.27 funlockfile F
GLIBC_2.27 lseek F
GLIBC_2.27 lseek64 F
GLIBC_2.27 msync F
GLIBC_2.27 nanosleep F
GLIBC_2.27 open F
GLIBC_2.27 open64 F
GLIBC_2.27 pause F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -195,7 +194,6 @@ GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -67,7 +67,6 @@ GLIBC_2.2 longjmp F
GLIBC_2.2 lseek F
GLIBC_2.2 lseek64 F
GLIBC_2.2 msync F
GLIBC_2.2 nanosleep F
GLIBC_2.2 open F
GLIBC_2.2 open64 F
GLIBC_2.2 pause F
@ -187,7 +186,6 @@ GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -65,7 +65,6 @@ GLIBC_2.2 longjmp F
GLIBC_2.2 lseek F
GLIBC_2.2 lseek64 F
GLIBC_2.2 msync F
GLIBC_2.2 nanosleep F
GLIBC_2.2 open F
GLIBC_2.2 open64 F
GLIBC_2.2 pause F
@ -185,7 +184,6 @@ GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -65,7 +65,6 @@ GLIBC_2.2 longjmp F
GLIBC_2.2 lseek F
GLIBC_2.2 lseek64 F
GLIBC_2.2 msync F
GLIBC_2.2 nanosleep F
GLIBC_2.2 open F
GLIBC_2.2 open64 F
GLIBC_2.2 pause F
@ -185,7 +184,6 @@ GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -42,7 +42,6 @@ GLIBC_2.0 funlockfile F
GLIBC_2.0 longjmp F
GLIBC_2.0 lseek F
GLIBC_2.0 msync F
GLIBC_2.0 nanosleep F
GLIBC_2.0 open F
GLIBC_2.0 pause F
GLIBC_2.0 pthread_atfork F
@ -193,7 +192,6 @@ GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -65,7 +65,6 @@ GLIBC_2.2 longjmp F
GLIBC_2.2 lseek F
GLIBC_2.2 lseek64 F
GLIBC_2.2 msync F
GLIBC_2.2 nanosleep F
GLIBC_2.2 open F
GLIBC_2.2 open64 F
GLIBC_2.2 pause F
@ -185,7 +184,6 @@ GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -65,7 +65,6 @@ GLIBC_2.2.5 longjmp F
GLIBC_2.2.5 lseek F
GLIBC_2.2.5 lseek64 F
GLIBC_2.2.5 msync F
GLIBC_2.2.5 nanosleep F
GLIBC_2.2.5 open F
GLIBC_2.2.5 open64 F
GLIBC_2.2.5 pause F
@ -185,7 +184,6 @@ GLIBC_2.2.5 tcdrain F
GLIBC_2.2.5 wait F
GLIBC_2.2.5 waitpid F
GLIBC_2.2.5 write F
GLIBC_2.2.6 __nanosleep F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F

View File

@ -11,7 +11,6 @@ GLIBC_2.16 __libc_allocate_rtsig F
GLIBC_2.16 __libc_current_sigrtmax F
GLIBC_2.16 __libc_current_sigrtmin F
GLIBC_2.16 __lseek F
GLIBC_2.16 __nanosleep F
GLIBC_2.16 __open F
GLIBC_2.16 __open64 F
GLIBC_2.16 __pread64 F
@ -64,7 +63,6 @@ GLIBC_2.16 longjmp F
GLIBC_2.16 lseek F
GLIBC_2.16 lseek64 F
GLIBC_2.16 msync F
GLIBC_2.16 nanosleep F
GLIBC_2.16 open F
GLIBC_2.16 open64 F
GLIBC_2.16 pause F

View File

@ -73,6 +73,7 @@ CFLAGS-tzfile.c += $(tz-cflags)
CFLAGS-tzset.c += $(tz-cflags)
CFLAGS-getdate.c += -fexceptions
CFLAGS-clock_nanosleep.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
# Don't warn about Y2k problem in strftime format string.
CFLAGS-test_time.c += -Wno-format