blob: 7e80582e0e8817b8975f497485cca9b2d203313b [file] [log] [blame]
Fei Jie0ebe67b2016-03-25 17:47:13 +08001#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
13int
14main(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
27SKIP_MAIN_UNDEFINED("__NR_mknod")
28
29#endif