blob: 382f47da1459d9da6b4be4920ec43830f06c0bb2 [file] [log] [blame]
Fei Jie4c4ab0f2016-03-31 16:06:51 +08001#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
10int
11main(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
25SKIP_MAIN_UNDEFINED("__NR_fdatasync")
26
27#endif