blob: abf569f710d2dc2a77f6e5fe14f18ee0d033d28a [file] [log] [blame]
Fei Jiee2975b62016-03-25 17:47:15 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_faccessat
5
6# include <errno.h>
7# include <stdio.h>
8# include <unistd.h>
9
10# define TMP_FILE "faccessat_tmpfile"
11
12int
13main(void)
14{
15 const long int fd = (long int) 0xdeadbeefffffffff;
16 int rc = syscall(__NR_faccessat, fd, TMP_FILE, F_OK);
17 printf("faccessat(%d, \"%s\", F_OK) = %d %s (%m)\n",
18 (int) fd, TMP_FILE, rc,
19 errno == ENOSYS ? "ENOSYS" : "EBADF");
20
21 puts("+++ exited with 0 +++");
22 return 0;
23}
24
25#else
26
27SKIP_MAIN_UNDEFINED("__NR_faccessat")
28
29#endif