mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 18:23:39 +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:
parent
ad53f6afd3
commit
c30e2c8d44
Notes:
sideshowbarker
2024-07-19 15:55:24 +09:00
Author: https://github.com/awesomekling
Commit: c30e2c8d44
22 changed files with 156 additions and 4 deletions
|
@ -1292,3 +1292,13 @@ size_t Ext2FSInode::directory_entry_count() const
|
|||
LOCKER(m_lock);
|
||||
return m_lookup_cache.size();
|
||||
}
|
||||
|
||||
bool Ext2FSInode::chmod(mode_t mode, int& error)
|
||||
{
|
||||
error = 0;
|
||||
if (m_raw_inode.i_mode == mode)
|
||||
return true;
|
||||
m_raw_inode.i_mode = mode;
|
||||
set_metadata_dirty(true);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue