2018-04-17 14:03:19 +03:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
2018-04-17 15:49:56 +03:00
|
|
|
#include <syscall.h>
|
2018-12-10 04:09:27 +03:00
|
|
|
#include <syscall_nums.h>
|
|
|
|
|
|
|
|
DEFN_SYSCALL2(access, SYS_ACCESS, char *, int);
|
2018-04-17 14:03:19 +03:00
|
|
|
|
|
|
|
int access(const char *pathname, int mode) {
|
|
|
|
int result = syscall_access((char *)pathname, mode);
|
|
|
|
if (result < 0) {
|
|
|
|
errno = ENOENT; /* XXX */
|
2019-08-08 03:42:44 +03:00
|
|
|
return -1;
|
2018-04-17 14:03:19 +03:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|