From: Rich Felker Date: Sat, 3 Aug 2013 06:28:35 +0000 (-0400) Subject: collapse euidaccess to a call to faccessat X-Git-Tag: v0.9.13~87 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=89384f78ce79efba22ab3a77e50c3f2a95233f8c;p=oweals%2Fmusl.git collapse euidaccess to a call to faccessat it turns out Linux is buggy for faccessat, just like fchmodat: the kernel does not actually take a flags argument. so we're going to have to emulate it there. --- diff --git a/src/legacy/euidaccess.c b/src/legacy/euidaccess.c index f37a4ecf..47b464d3 100644 --- a/src/legacy/euidaccess.c +++ b/src/legacy/euidaccess.c @@ -1,18 +1,10 @@ #include #include -#include -#include "syscall.h" #include "libc.h" int euidaccess(const char *filename, int amode) { - int ret = __syscall(SYS_faccessat, AT_FDCWD, filename, amode, AT_EACCESS); - if (ret != -ENOSYS) return __syscall_ret(ret); - - if (getuid() == geteuid() && getgid() == getegid()) - return syscall(SYS_access, filename, amode); - - return __syscall_ret(-ENOSYS); + return faccessat(AT_FDCWD, filename, amode, AT_EACCESS); } weak_alias(euidaccess, eaccess);