summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-18 14:57:41 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-18 15:02:16 +0100
commitde4604ac95261fe95f5921b0d16ee65fb501332a (patch)
tree16bf9be7e4d94862179c99d5cdcee29a0b7ca744 /Kernel/Process.cpp
parent303577df16cf990d1c0cb2c83cd8a954258809ba (diff)
downloadserenity-de4604ac95261fe95f5921b0d16ee65fb501332a.zip
Finally hook up the mkdir code to a syscall.
Added a /bin/mkdir that makes directories. How very neat :^) There are various limitations because of missing functionality.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 94ab2fdd6b..8dd94efec1 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -1751,3 +1751,15 @@ int Process::sys$setgroups(size_t count, const gid_t* gids)
m_gids.set(gids[i]);
return 0;
}
+
+int Process::sys$mkdir(const char* pathname, mode_t mode)
+{
+ if (!validate_read_str(pathname))
+ return -EFAULT;
+ if (strlen(pathname) >= 255)
+ return -ENAMETOOLONG;
+ int error;
+ if (!VFS::the().mkdir(pathname, mode, cwd_inode()->identifier(), error))
+ return error;
+ return 0;
+}