blob: cd25185c312aac87810c7030602a6cc975b8b431 [file] [log] [blame]
Fei Jieb824f982016-03-15 16:38:34 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_flock
5
6# include <errno.h>
7# include <sys/file.h>
8# include <stdio.h>
9# include <unistd.h>
10
11int
12main(void)
13{
14 const unsigned long fd = (long int) 0xdeadbeefffffffff;
15 int rc = syscall(__NR_flock, fd, LOCK_SH);
16 printf("flock(%d, LOCK_SH) = %d %s (%m)\n",
17 (int) fd, rc,
18 errno == ENOSYS ? "ENOSYS" : "EBADF");
19
20 puts("+++ exited with 0 +++");
21 return 0;
22}
23
24#else
25
26SKIP_MAIN_UNDEFINED("__NR_flock")
27
28#endif