blob: 52d9d62d683cbfc0c2231831d6d5bfc3521e9ffe [file] [log] [blame]
Fei Jie8346e632016-03-25 17:47:14 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_creat
5
6# include <errno.h>
7# include <stdio.h>
8# include <sys/stat.h>
9# include <unistd.h>
10
11# define TMP_FILE "creat"
12
13int
14main(void)
15{
16 int rc = syscall(__NR_creat, TMP_FILE, S_IRUSR);
17 printf("creat(\"%s\", %#o) = %d %s (%m)\n",
18 TMP_FILE, S_IRUSR, rc,
Dmitry V. Levin9f6611b2016-04-21 17:49:32 +000019 errno2name());
Fei Jie8346e632016-03-25 17:47:14 +080020
21 puts("+++ exited with 0 +++");
22 return 0;
23}
24
25#else
26
27SKIP_MAIN_UNDEFINED("__NR_creat")
28
29#endif