Fei Jie | 16c078e | 2016-03-31 16:06:50 +0800 | [diff] [blame^] | 1 | #include "tests.h" |
2 | #include <sys/syscall.h> | ||||
3 | |||||
4 | #ifdef __NR_fsync | ||||
5 | |||||
6 | # include <errno.h> | ||||
7 | # include <stdio.h> | ||||
8 | # include <unistd.h> | ||||
9 | |||||
10 | int | ||||
11 | main(void) | ||||
12 | { | ||||
13 | const long int fd = (long int) 0xdeadbeefffffffff; | ||||
14 | int rc = syscall(__NR_fsync, fd); | ||||
15 | printf("fsync(%d) = %d %s (%m)\n", | ||||
16 | (int) fd, rc, | ||||
17 | errno == ENOSYS ? "ENOSYS" : "EBADF"); | ||||
18 | |||||
19 | puts("+++ exited with 0 +++"); | ||||
20 | return 0; | ||||
21 | } | ||||
22 | |||||
23 | #else | ||||
24 | |||||
25 | SKIP_MAIN_UNDEFINED("__NR_fsync") | ||||
26 | |||||
27 | #endif |