1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:58:11 +00:00

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.
This commit is contained in:
Andreas Kling 2019-02-21 13:26:40 +01:00
parent b6115ee5b7
commit 7d288aafb2
13 changed files with 138 additions and 93 deletions

View file

@ -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)