diff options
70 files changed, 182 insertions, 82 deletions
diff --git a/include/shm-directory.h b/include/shm-directory.h index 1d3ffb6137..25e9484a5d 100644 --- a/include/shm-directory.h +++ b/include/shm-directory.h @@ -37,5 +37,6 @@ struct shmdir_name SEM_PREFIX is true. */ int __shm_get_name (struct shmdir_name *result, const char *name, bool sem_prefix); +libc_hidden_proto (__shm_get_name) #endif /* shm-directory.h */ diff --git a/include/stdlib.h b/include/stdlib.h index cdbdbf310d..e2453c1896 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -91,6 +91,7 @@ extern int __setenv (const char *__name, const char *__value, int __replace) extern int __unsetenv (const char *__name) attribute_hidden; extern int __clearenv (void) attribute_hidden; extern char *__mktemp (char *__template) __THROW __nonnull ((1)); +libc_hidden_proto (__mktemp) extern char *__canonicalize_file_name (const char *__name); extern char *__realpath (const char *__name, char *__resolved); libc_hidden_proto (__realpath) diff --git a/misc/mktemp.c b/misc/mktemp.c index 92bb121ddf..07f195f845 100644 --- a/misc/mktemp.c +++ b/misc/mktemp.c @@ -30,6 +30,7 @@ __mktemp (char *template) return template; } +libc_hidden_def (__mktemp) weak_alias (__mktemp, mktemp) link_warning (mktemp, "the use of `mktemp' is dangerous, " diff --git a/nptl/Makefile b/nptl/Makefile index 66fd90049e..ab24222c1d 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -151,6 +151,9 @@ routines = \ pthread_testcancel \ pthread_yield \ sem_clockwait \ + sem_close \ + sem_open \ + sem_routines \ tpp \ unwind \ @@ -202,13 +205,10 @@ libpthread-routines = \ pthread_sigqueue \ pthread_timedjoin \ pthread_tryjoin \ - sem_close \ sem_destroy \ sem_getvalue \ sem_init \ - sem_open \ sem_post \ - sem_routines \ sem_timedwait \ sem_unlink \ sem_wait \ diff --git a/nptl/Versions b/nptl/Versions index 97567b6354..4a9e5a0305 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -81,6 +81,10 @@ libc { pthread_rwlockattr_setkind_np; pthread_rwlockattr_setpshared; } + GLIBC_2.1.1 { + sem_close; + sem_open; + } GLIBC_2.2 { __pthread_rwlock_destroy; __pthread_rwlock_init; @@ -249,6 +253,8 @@ libc { pthread_spin_unlock; pthread_testcancel; sem_clockwait; + sem_close; + sem_open; thrd_exit; tss_create; tss_delete; @@ -341,8 +347,6 @@ libpthread { } GLIBC_2.1.1 { - sem_close; - sem_open; sem_unlink; } diff --git a/posix/shm-directory.c b/posix/shm-directory.c index c06bf96aa7..5dd640ebd0 100644 --- a/posix/shm-directory.c +++ b/posix/shm-directory.c @@ -42,5 +42,6 @@ __shm_get_name (struct shmdir_name *result, const char *name, bool sem_prefix) return -1; return 0; } +libc_hidden_def (__shm_get_name) #endif diff --git a/sysdeps/pthread/sem_close.c b/sysdeps/pthread/sem_close.c index 6649196cac..212848f745 100644 --- a/sysdeps/pthread/sem_close.c +++ b/sysdeps/pthread/sem_close.c @@ -21,7 +21,7 @@ #include <sem_routines.h> int -sem_close (sem_t *sem) +__sem_close (sem_t *sem) { if (!__sem_remove_mapping (sem)) { @@ -31,3 +31,11 @@ sem_close (sem_t *sem) return 0; } +#if PTHREAD_IN_LIBC +versioned_symbol (libc, __sem_close, sem_close, GLIBC_2_34); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34) +compat_symbol (libpthread, __sem_close, sem_close, GLIBC_2_1_1); +# endif +#else /* !PTHREAD_IN_LIBC */ +strong_alias (__sem_close, sem_close) +#endif diff --git a/sysdeps/pthread/sem_open.c b/sysdeps/pthread/sem_open.c index 0265abc45b..770ab17cdb 100644 --- a/sysdeps/pthread/sem_open.c +++ b/sysdeps/pthread/sem_open.c @@ -27,8 +27,14 @@ #include <futex-internal.h> #include <libc-lock.h> +#if !PTHREAD_IN_LIBC +/* The private names are not exported from libc. */ +# define __link link +# define __unlink unlink +#endif + sem_t * -sem_open (const char *name, int oflag, ...) +__sem_open (const char *name, int oflag, ...) { int fd; sem_t *result; @@ -59,8 +65,8 @@ sem_open (const char *name, int oflag, ...) if ((oflag & O_CREAT) == 0 || (oflag & O_EXCL) == 0) { try_again: - fd = open (dirname.name, - (oflag & ~(O_CREAT|O_ACCMODE)) | O_NOFOLLOW | O_RDWR); + fd = __open (dirname.name, + (oflag & ~(O_CREAT|O_ACCMODE)) | O_NOFOLLOW | O_RDWR); if (fd == -1) { @@ -127,7 +133,7 @@ sem_open (const char *name, int oflag, ...) } /* Open the file. Make sure we do not overwrite anything. */ - fd = open (tmpfname, O_RDWR | O_CREAT | O_EXCL, mode); + fd = __open (tmpfname, O_RDWR | O_CREAT | O_EXCL, mode); if (fd == -1) { if (errno == EEXIST) @@ -154,15 +160,15 @@ sem_open (const char *name, int oflag, ...) if (TEMP_FAILURE_RETRY (write (fd, &a |
