blob: e4c3ca97bc095e6e8103708e5582e264880536bf [file] [log] [blame]
Fei Jiee2975b62016-03-25 17:47:15 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_faccessat
5
6# include <errno.h>
7# include <stdio.h>
8# include <unistd.h>
9
Fei Jiee2975b62016-03-25 17:47:15 +080010int
11main(void)
12{
Dmitry V. Levin90406df2016-03-28 00:16:17 +000013 static const char sample[] = "faccessat.sample";
Fei Jiee2975b62016-03-25 17:47:15 +080014 const long int fd = (long int) 0xdeadbeefffffffff;
Dmitry V. Levin90406df2016-03-28 00:16:17 +000015
Dmitry V. Levina2633102016-04-21 20:38:47 +000016 long rc = syscall(__NR_faccessat, fd, sample, F_OK);
17 printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n",
18 (int) fd, sample, rc, errno2name());
Fei Jiee2975b62016-03-25 17:47:15 +080019
20 puts("+++ exited with 0 +++");
21 return 0;
22}
23
24#else
25
26SKIP_MAIN_UNDEFINED("__NR_faccessat")
27
28#endif