Fei Jie | 4c4ab0f | 2016-03-31 16:06:51 +0800 | [diff] [blame^] | 1 | #include "tests.h" |
| 2 | #include <sys/syscall.h> |
| 3 | |
| 4 | #ifdef __NR_fdatasync |
| 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_fdatasync, fd); |
| 15 | printf("fdatasync(%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_fdatasync") |
| 26 | |
| 27 | #endif |