Fei Jie | 0ebe67b | 2016-03-25 17:47:13 +0800 | [diff] [blame^] | 1 | #include "tests.h" |
| 2 | #include <sys/syscall.h> |
| 3 | |
| 4 | #ifdef __NR_mknod |
| 5 | |
| 6 | # include <errno.h> |
| 7 | # include <stdio.h> |
| 8 | # include <sys/stat.h> |
| 9 | # include <unistd.h> |
| 10 | |
| 11 | # define TMP_FILE "mknod" |
| 12 | |
| 13 | int |
| 14 | main(void) |
| 15 | { |
| 16 | int rc = syscall(__NR_mknod, TMP_FILE, S_IFREG|0600, 0); |
| 17 | printf("mknod(\"%s\", S_IFREG|0600) = %d %s (%m)\n", |
| 18 | TMP_FILE, rc, |
| 19 | errno == ENOSYS ? "ENOSYS" : "EEXIST"); |
| 20 | |
| 21 | puts("+++ exited with 0 +++"); |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | #else |
| 26 | |
| 27 | SKIP_MAIN_UNDEFINED("__NR_mknod") |
| 28 | |
| 29 | #endif |