Kernel/LibC: Implement unlinkat

This commit is contained in:
2025-06-01 05:06:47 +03:00
parent 91756c057e
commit b75970958e
4 changed files with 18 additions and 6 deletions

View File

@@ -518,12 +518,17 @@ int fdatasync(int fildes)
int unlink(const char* path)
{
return syscall(SYS_UNLINK, path);
return unlinkat(AT_FDCWD, path, 0);
}
int unlinkat(int fd, const char* path, int flag)
{
return syscall(SYS_UNLINKAT, fd, path, flag);
}
int rmdir(const char* path)
{
return syscall(SYS_UNLINK, path);
return unlinkat(AT_FDCWD, path, AT_REMOVEDIR);
}
char* optarg = nullptr;