Kernel/LibC: Add support for creating hardlinks

This commit is contained in:
2024-12-03 16:07:30 +02:00
parent 12abe81c6d
commit 713daf6cd3
8 changed files with 76 additions and 0 deletions

View File

@@ -90,6 +90,7 @@ __BEGIN_DECLS
O(SYS_PTSNAME, ptsname) \
O(SYS_FSYNC, fsync) \
O(SYS_SYMLINKAT, symlinkat) \
O(SYS_HARDLINKAT, hardlinkat) \
enum Syscall
{

View File

@@ -630,3 +630,13 @@ int symlinkat(const char* path1, int fd, const char* path2)
{
return syscall(SYS_SYMLINKAT, path1, fd, path2);
}
int link(const char* path1, const char* path2)
{
return linkat(AT_FDCWD, path1, AT_FDCWD, path2, 0);
}
int linkat(int fd1, const char *path1, int fd2, const char *path2, int flag)
{
return syscall(SYS_HARDLINKAT, fd1, path1, fd2, path2, flag);
}