diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-21 13:26:40 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-21 13:26:40 +0100 |
commit | 7d288aafb25f44a63cf1e4c3e262b4906bc12b21 (patch) | |
tree | d35e02d7a9441889cab5d3455e12a341f3110a0d /LibC/unistd.cpp | |
parent | b6115ee5b7aaccc6c8597534cc64d339e038f578 (diff) | |
download | serenity-7d288aafb25f44a63cf1e4c3e262b4906bc12b21.zip |
Kernel: Add link() syscall to create hard links.
This accidentally grew into a little bit of VFS cleanup as well.
Also add a simple /bin/ln implementation to exercise it.
Diffstat (limited to 'LibC/unistd.cpp')
-rw-r--r-- | LibC/unistd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/LibC/unistd.cpp b/LibC/unistd.cpp index d6ec950f7d..6ae189210c 100644 --- a/LibC/unistd.cpp +++ b/LibC/unistd.cpp @@ -229,9 +229,10 @@ off_t lseek(int fd, off_t offset, int whence) __RETURN_WITH_ERRNO(rc, rc, -1); } -int link(const char*, const char*) +int link(const char* old_path, const char* new_path) { - assert(false); + int rc = syscall(SC_link, old_path, new_path); + __RETURN_WITH_ERRNO(rc, rc, -1); } int unlink(const char* pathname) |