mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
Implement basic chmod() syscall and /bin/chmod helper.
Only raw octal modes are supported right now. This patch also changes mode_t from 32-bit to 16-bit to match the on-disk type used by Ext2FS. I also ran into EPERM being errno=0 which was confusing, so I inserted an ESUCCESS in its place.
This commit is contained in:
@@ -2120,3 +2120,13 @@ int Process::sys$read_tsc(dword* lsw, dword* msw)
|
||||
read_tsc(*lsw, *msw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$chmod(const char* pathname, mode_t mode)
|
||||
{
|
||||
if (!validate_read_str(pathname))
|
||||
return -EFAULT;
|
||||
int error;
|
||||
if (!VFS::the().chmod(String(pathname), mode, *cwd_inode(), error))
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user