Luna/kernel/src/sys/mkdir.cpp

16 lines
340 B
C++
Raw Normal View History

2023-03-12 14:32:09 +00:00
#include "Log.h"
#include "fs/VFS.h"
#include "memory/MemoryManager.h"
#include "sys/Syscall.h"
Result<u64> sys_mkdir(Registers*, SyscallArgs args)
{
2023-03-12 15:30:36 +00:00
auto path = TRY(MemoryManager::strdup_from_user(args[0]));
2023-03-12 14:32:09 +00:00
2023-03-12 15:30:36 +00:00
kinfoln("mkdir: attempting to create %s", path.chars());
2023-03-12 14:32:09 +00:00
2023-03-12 15:30:36 +00:00
TRY(VFS::create_directory(path.chars()));
2023-03-12 14:32:09 +00:00
return 0;
}