blob: 774420eef7079867983b87881fad0bd4b4bccc48 [file] [log] [blame]
Fei Jie16c078e2016-03-31 16:06:50 +08001#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
10int
11main(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
25SKIP_MAIN_UNDEFINED("__NR_fsync")
26
27#endif