toaruos/libc/unistd/access.c
2019-08-08 09:42:44 +09:00

17 lines
317 B
C

#include <unistd.h>
#include <errno.h>
#include <syscall.h>
#include <syscall_nums.h>
DEFN_SYSCALL2(access, SYS_ACCESS, char *, int);
int access(const char *pathname, int mode) {
int result = syscall_access((char *)pathname, mode);
if (result < 0) {
errno = ENOENT; /* XXX */
return -1;
}
return result;
}