1 | // SPDX-License-Identifier: GPL-3.0-or-later |
---|---|
2 | |
3 | #include "mosapi.h" |
4 | |
5 | void do_mkdir(const char *path) |
6 | { |
7 | if (syscall_vfs_mkdir(path) != 0) |
8 | fprintf(stderr, format: "failed to create directory '%s'\n", path); |
9 | } |
10 | |
11 | int main(int argc, char **argv) |
12 | { |
13 | if (argc < 2) |
14 | { |
15 | fputs(s: "usage: mkdir <dir>...\n", stderr); |
16 | return 1; |
17 | } |
18 | |
19 | for (int i = 1; i < argc; i++) |
20 | do_mkdir(path: argv[i]); |
21 | |
22 | return 0; |
23 | } |
24 |