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