-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_creat.c
More file actions
22 lines (21 loc) · 985 Bytes
/
Copy pathtest_creat.c
File metadata and controls
22 lines (21 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define _GNU_SOURCE
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/syscall.h>
int main(void) {
int fd;
fd = syscall(SYS_creat, "/tmp/tst_creat0", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat1", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat2", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat3", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat4", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat5", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat6", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat7", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat8", 0644); if (fd >= 0) close(fd);
fd = syscall(SYS_creat, "/tmp/tst_creat9", 0644); if (fd >= 0) close(fd);
return 0;
}