mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user