headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / libroot / posix / unistd / access.c
blobdbc14b917c806bd3e13eb0026a66eb91a14d85fd
1 /*
2 * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <errno.h>
8 #include <unistd.h>
10 #include <errno_private.h>
11 #include <syscalls.h>
12 #include <syscall_utils.h>
15 int
16 access(const char* path, int accessMode)
18 status_t status = _kern_access(-1, path, accessMode, false);
20 RETURN_AND_SET_ERRNO(status);
24 int
25 faccessat(int fd, const char* path, int accessMode, int flag)
27 status_t status = _kern_access(fd, path, accessMode,
28 (flag & AT_EACCESS) != 0);
30 RETURN_AND_SET_ERRNO(status);