OSDN Git Service

add support for euidaccess/eaccess legacy functions
authorWaldemar Brodkorb <wbx@openadk.org>
Sun, 8 Nov 2015 19:38:23 +0000 (20:38 +0100)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>
Thu, 12 Nov 2015 05:15:02 +0000 (06:15 +0100)
Implementation taken from musl libc project.
Missing functions recognized by buildroot autobuilders
with failing open-vm-tools.

include/unistd.h
libc/sysdeps/linux/common/Makefile.in
libc/sysdeps/linux/common/euidaccess.c [new file with mode: 0644]

index 40d6abd..8e4daf6 100644 (file)
@@ -290,7 +290,7 @@ typedef __socklen_t socklen_t;
 /* Test for access to NAME using the real UID and real GID.  */
 extern int access (const char *__name, int __type) __THROW __nonnull ((1));
 
-#if 0 /*def __USE_GNU*/
+#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
 /* Test for access to NAME using the effective UID and GID
    (as normal file operations use).  */
 extern int euidaccess (const char *__name, int __type)
index b75b712..ade0ac3 100644 (file)
@@ -24,6 +24,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
        capget.c \
        capset.c \
        dup3.c \
+       euidaccess.c \
        eventfd.c \
        eventfd_read.c \
        eventfd_write.c \
diff --git a/libc/sysdeps/linux/common/euidaccess.c b/libc/sysdeps/linux/common/euidaccess.c
new file mode 100644 (file)
index 0000000..6e1f398
--- /dev/null
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+
+int euidaccess(const char *filename, int amode)
+{
+       return faccessat(AT_FDCWD, filename, amode, AT_EACCESS);
+}
+
+weak_alias(euidaccess, eaccess);