1 #include "tests.h" 2 #include <asm/unistd.h> 3 4 #ifdef __NR_access 5 6 # include <stdio.h> 7 # include <unistd.h> 8 9 int 10 main(void) 11 { 12 static const char sample[] = "access_sample"; 13 14 long rc = syscall(__NR_access, sample, F_OK); 15 printf("access(\"%s\", F_OK) = %ld %s (%m)\n", 16 sample, rc, errno2name()); 17 18 rc = syscall(__NR_access, sample, R_OK|W_OK|X_OK); 19 printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", 20 sample, rc, errno2name()); 21 22 puts("+++ exited with 0 +++"); 23 return 0; 24 } 25 26 #else 27 28 SKIP_MAIN_UNDEFINED("__NR_access") 29 30 #endif 31