From 545c5f85c38de8ddb8c026bf3b76658c8d8f3d6b Mon Sep 17 00:00:00 2001 From: WlodekM Date: Sat, 15 Feb 2025 10:51:57 +0200 Subject: fix some stuff; add some coreutils --- progs/mount/mount.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 progs/mount/mount.c (limited to 'progs/mount') diff --git a/progs/mount/mount.c b/progs/mount/mount.c new file mode 100644 index 0000000..296dd42 --- /dev/null +++ b/progs/mount/mount.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 4) { + fprintf(stderr, "usag: %s \n", argv[0]); + return EXIT_FAILURE; + } + + const char *source = argv[1]; + const char *target = argv[2]; + const char *fstype = argv[3]; + + if (mount(source, target, fstype, 0, NULL) == -1) { + fprintf(stderr, "mount failed: %s\n", strerror(errno)); + return EXIT_FAILURE; + } + + printf("Mounted %s on %s with type %s\n", source, target, fstype); + return EXIT_SUCCESS; +} \ No newline at end of file -- cgit 1.4.1-2-gfad0