提交 a89aaee1 编写于 作者: R Rich Felker

add legacy euidaccess function and eaccess alias for it

this is mainly for ABI compat purposes.
上级 d3a98ff6
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#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);
}
weak_alias(euidaccess, eaccess);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册