mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-19 14:14:41 +00:00
Add unlink() syscall and /bin/rm.
This patch adds most of the plumbing for working file deletion in Ext2FS. Directory entries are removed and inode link counts updated. We don't yet update the inode or block bitmaps, I will do that separately.
This commit is contained in:
@@ -2009,3 +2009,13 @@ Inode* Process::cwd_inode()
|
||||
m_cwd = VFS::the().root_inode();
|
||||
return m_cwd.ptr();
|
||||
}
|
||||
|
||||
int Process::sys$unlink(const char* pathname)
|
||||
{
|
||||
if (!validate_read_str(pathname))
|
||||
return -EFAULT;
|
||||
int error;
|
||||
if (!VFS::the().unlink(String(pathname), *cwd_inode(), error))
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user