Fei Jie | 5c1776f | 2016-04-21 15:53:49 +0800 | [diff] [blame^] | 1 | #include "tests.h" |
2 | #include <sys/syscall.h> | ||||
3 | |||||
4 | #ifdef __NR_mkdir | ||||
5 | |||||
6 | # include <errno.h> | ||||
7 | # include <stdio.h> | ||||
8 | # include <unistd.h> | ||||
9 | |||||
10 | int | ||||
11 | main(void) | ||||
12 | { | ||||
13 | static const char sample[] = "mkdir"; | ||||
14 | |||||
15 | long rc = syscall(__NR_mkdir, sample, 0600); | ||||
16 | printf("mkdir(\"%s\", 0600) = %ld %s (%m)\n", | ||||
17 | sample, rc, errno == ENOSYS ? "ENOSYS" : "EEXIST"); | ||||
18 | |||||
19 | puts("+++ exited with 0 +++"); | ||||
20 | return 0; | ||||
21 | } | ||||
22 | |||||
23 | #else | ||||
24 | |||||
25 | SKIP_MAIN_UNDEFINED("__NR_mkdir") | ||||
26 | |||||
27 | #endif |