Fei Jie | e2975b6 | 2016-03-25 17:47:15 +0800 | [diff] [blame] | 1 | #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 | |
Fei Jie | e2975b6 | 2016-03-25 17:47:15 +0800 | [diff] [blame] | 10 | int |
| 11 | main(void) |
| 12 | { |
Dmitry V. Levin | 90406df | 2016-03-28 00:16:17 +0000 | [diff] [blame] | 13 | static const char sample[] = "faccessat.sample"; |
Fei Jie | e2975b6 | 2016-03-25 17:47:15 +0800 | [diff] [blame] | 14 | const long int fd = (long int) 0xdeadbeefffffffff; |
Dmitry V. Levin | 90406df | 2016-03-28 00:16:17 +0000 | [diff] [blame] | 15 | |
Dmitry V. Levin | a263310 | 2016-04-21 20:38:47 +0000 | [diff] [blame^] | 16 | long rc = syscall(__NR_faccessat, fd, sample, F_OK); |
| 17 | printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n", |
| 18 | (int) fd, sample, rc, errno2name()); |
Fei Jie | e2975b6 | 2016-03-25 17:47:15 +0800 | [diff] [blame] | 19 | |
| 20 | puts("+++ exited with 0 +++"); |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | #else |
| 25 | |
| 26 | SKIP_MAIN_UNDEFINED("__NR_faccessat") |
| 27 | |
| 28 | #endif |