xref: /haiku/src/system/libroot/posix/unistd/access.c (revision fc7456e9b1ec38c941134ed6d01c438cf289381e)
1 /*
2  * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <errno.h>
8 #include <unistd.h>
9 
10 #include <errno_private.h>
11 #include <syscalls.h>
12 #include <syscall_utils.h>
13 
14 
15 int
16 access(const char* path, int accessMode)
17 {
18 	return faccessat(AT_FDCWD, path, accessMode, 0);
19 }
20 
21 
22 int
23 faccessat(int fd, const char* path, int accessMode, int flag)
24 {
25 	RETURN_AND_SET_ERRNO(_kern_access(fd, path, accessMode,
26 		(flag & AT_EACCESS) != 0));
27 }
28