blob: d922dd7c29a57ab75e6ade417c15362aec3928ab [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,
19 errno == ENOSYS ? "ENOSYS" : "ETXTBSY");
20
21 puts("+++ exited with 0 +++");
22 return 0;
23}
24
25#else
26
27SKIP_MAIN_UNDEFINED("__NR_creat")
28
29#endif