diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-06-21 08:25:15 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-06-21 08:25:15 +0200 |
| commit | ae830b2d9f5238e1bee9820cd4d4df7f7b13ecff (patch) | |
| tree | 0b3afe2777d45064178f549c15a674f110a4432a | |
| parent | c6e7ec2f123bceb323836cc4558f9586959ebf58 (diff) | |
| download | glibc-ae830b2d9f5238e1bee9820cd4d4df7f7b13ecff.tar.xz glibc-ae830b2d9f5238e1bee9820cd4d4df7f7b13ecff.zip | |
rt: Move shm_unlink into libc
This function has no dependency on libpthread, so the move is also
applied to Hurd.
The symbol was moved using scripts/move-symbol-to-libc.py.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
67 files changed, 77 insertions, 35 deletions
diff --git a/rt/Makefile b/rt/Makefile index ba141c82f2..329db09c32 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -26,6 +26,7 @@ headers := aio.h mqueue.h bits/mqueue.h bits/mqueue2.h routines = \ shm_open \ + shm_unlink \ librt-routines = \ aio_cancel \ @@ -52,7 +53,6 @@ librt-routines = \ mq_timedreceive \ mq_timedsend \ mq_unlink \ - shm_unlink \ timer_create \ timer_delete \ timer_getoverr \ diff --git a/rt/Versions b/rt/Versions index e1d208eeb3..309486be1e 100644 --- a/rt/Versions +++ b/rt/Versions @@ -1,9 +1,11 @@ libc { GLIBC_2.2 { shm_open; + shm_unlink; } GLIBC_2.34 { shm_open; + shm_unlink; } } librt { @@ -27,7 +29,6 @@ librt { lio_listio64; } GLIBC_2.2 { - shm_unlink; timer_create; timer_delete; timer_getoverrun; diff --git a/rt/shm_unlink.c b/rt/shm_unlink.c index a5af5ac147..85e9360e4c 100644 --- a/rt/shm_unlink.c +++ b/rt/shm_unlink.c @@ -17,13 +17,14 @@ <https://www.gnu.org/licenses/>. */ #include <errno.h> +#include <shlib-compat.h> #include <shm-directory.h> #include <string.h> #include <unistd.h> /* Remove shared memory object. */ int -shm_unlink (const char *name) +__shm_unlink (const char *name) { struct shmdir_name dirname; if (__shm_get_name (&dirname, name, false) != 0) @@ -32,8 +33,13 @@ shm_unlink (const char *name) return -1; } - int result = unlink (dirname.name); + int result = __unlink (dirname.name); if (result < 0 && errno == EPERM) __set_errno (EACCES); return result; } +versioned_symbol (libc, __shm_unlink, shm_unlink, GLIBC_2_34); + +#if OTHER_SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libc, __shm_unlink, shm_unlink, GLIBC_2_2); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index f1e529f087..c3232ba32e 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -1567,6 +1567,7 @@ GLIBC_2.2.6 setvbuf F GLIBC_2.2.6 sgetspent F GLIBC_2.2.6 sgetspent_r F GLIBC_2.2.6 shm_open F +GLIBC_2.2.6 shm_unlink F GLIBC_2.2.6 shmat F GLIBC_2.2.6 shmctl F GLIBC_2.2.6 shmdt F @@ -2228,6 +2229,7 @@ GLIBC_2.34 dlsym F GLIBC_2.34 dlvsym F GLIBC_2.34 execveat F GLIBC_2.34 shm_open F +GLIBC_2.34 shm_unlink F GLIBC_2.34 timespec_getres F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F diff --git a/sysdeps/mach/hurd/i386/librt.abilist b/sysdeps/mach/hurd/i386/librt.abilist index efee87f824..022e10b897 100644 --- a/sysdeps/mach/hurd/i386/librt.abilist +++ b/sysdeps/mach/hurd/i386/librt.abilist @@ -15,7 +15,6 @@ GLIBC_2.2.6 aio_write F GLIBC_2.2.6 aio_write64 F GLIBC_2.2.6 lio_listio F GLIBC_2.2.6 lio_listio64 F -GLIBC_2.2.6 shm_unlink F GLIBC_2.2.6 timer_create F GLIBC_2.2.6 timer_delete F GLIBC_2.2.6 timer_getoverrun F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index f228fc17c3..42e240e284 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -1784,6 +1784,7 @@ GLIBC_2.17 sgetsgent_r F GLIBC_2.17 sgetspent F GLIBC_2.17 sgetspent_r F GLIBC_2.17 shm_open F +GLIBC_2.17 shm_unlink F GLIBC_2.17 shmat F GLIBC_2.17 shmctl F GLIBC_2.17 shmdt F @@ -2467,6 +2468,7 @@ GLIBC_2.34 sem_trywait F GLIBC_2.34 sem_unlink F GLIBC_2.34 sem_wait F GLIBC_2.34 shm_open F +GLIBC_2.34 shm_unlink F GLIBC_2.34 thrd_create F GLIBC_2.34 thrd_detach F GLIBC_2.34 thrd_exit F diff --git a/sysdeps/unix/sysv/linux/aarch64/librt.abilist b/sysdeps/unix/sysv/linux/aarch64/librt.abilist index 7ebb55d15e..c41e0e675b 100644 --- a/sysdeps/unix/sysv/linux/aarch64/librt.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/librt.abilist @@ -26,7 +26,6 @@ GLIBC_2.17 mq_setattr F GLIBC_2.17 mq_timedreceive F GLIBC_2.17 mq_timedsend F GLIBC_2.17 mq_unlink F -GLIBC_2.17 shm_unlink F GLIBC_2.17 timer_create F GLIBC_2.17 timer_delete F GLIBC_2.17 timer_getoverrun F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 5b90ab838a..fad54555dc 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2068,6 +2068,7 @@ GLIBC_2.2 ruserok_af F GLIBC_2.2 sem_timedwait F GLIBC_2.2 semctl F GLIBC_2.2 shm_open F +GLIBC_2.2 shm_unlink F GLIBC_2.2 shmctl F GLIBC_2.2 svc_getreq_common F GLIBC_2.2 svc_getreq_poll F @@ -2560,6 +2561,7 @@ GLIBC_2.34 sem_trywait F GLIBC_2.34 sem_unlink F GLIBC_2.34 sem_wait F GLIBC_2.34 shm_open F +GLIBC_2.34 s |
