1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #include <mos/syscall/usermode.h> |
4 | #include <stdio.h> |
5 | #include <string.h> |
6 | |
7 | int main(int argc, char **argv) |
8 | { |
9 | // mount <device> <mountpoint> <fstype> |
10 | if (argc != 4) |
11 | { |
12 | puts(string: "Usage: mount <device> <mountpoint> <fstype>" ); |
13 | return -1; |
14 | } |
15 | |
16 | const long ret = syscall_vfs_mount(device: argv[1], mount_point: argv[2], fs_type: argv[3], options: "" ); |
17 | if (ret < 0) |
18 | { |
19 | printf(format: "Failed to mount: %ld (%s)\n" , ret, strerror(errnum: -ret)); |
20 | return -1; |
21 | } |
22 | |
23 | return 0; |
24 | } |
25 | |