Luna/apps/umount.cpp
apio 1f4c4928cc
All checks were successful
continuous-integration/drone/push Build is passing
kernel+libc+apps: Add mount and umount syscalls, libc wrappers, and utilities
2023-05-17 20:30:15 +02:00

23 lines
486 B
C++

#include <os/ArgumentParser.h>
#include <stdio.h>
#include <sys/mount.h>
Result<int> luna_main(int argc, char** argv)
{
StringView target;
os::ArgumentParser parser;
parser.add_description("Unmount a file system.");
parser.add_system_program_info("umount"_sv);
parser.add_positional_argument(target, "mountpoint"_sv, true);
parser.parse(argc, argv);
if (umount(target.chars()) < 0)
{
perror("umount");
return 1;
}
return 0;
}