blob: 06a6ae36954824ce3c98b5225179da0140f6e0e1 [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
Fei Jiee2975b62016-03-25 17:47:15 +08006# include <stdio.h>
7# include <unistd.h>
8
Fei Jiee2975b62016-03-25 17:47:15 +08009int
10main(void)
11{
Dmitry V. Levin90406df2016-03-28 00:16:17 +000012 static const char sample[] = "faccessat.sample";
Fei Jiee2975b62016-03-25 17:47:15 +080013 const long int fd = (long int) 0xdeadbeefffffffff;
Dmitry V. Levin90406df2016-03-28 00:16:17 +000014
Dmitry V. Levina2633102016-04-21 20:38:47 +000015 long rc = syscall(__NR_faccessat, fd, sample, F_OK);
16 printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n",
17 (int) fd, sample, rc, errno2name());
Fei Jiee2975b62016-03-25 17:47:15 +080018
19 puts("+++ exited with 0 +++");
20 return 0;
21}
22
23#else
24
25SKIP_MAIN_UNDEFINED("__NR_faccessat")
26
27#endif