mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:45:07 +00:00
Kernel+Userland: Implement fchmod() syscall and use it to improve /bin/cp.
/bin/cp will now copy the permission bits from source to destination. :^)
This commit is contained in:
parent
b5e5f26a82
commit
1b16a29044
10 changed files with 54 additions and 14 deletions
|
@ -138,6 +138,13 @@ int FileDescriptor::fstat(stat* buffer)
|
|||
return 0;
|
||||
}
|
||||
|
||||
KResult FileDescriptor::fchmod(mode_t mode)
|
||||
{
|
||||
if (!m_inode)
|
||||
return KResult(-EBADF);
|
||||
return VFS::the().chmod(*m_inode, mode);
|
||||
}
|
||||
|
||||
off_t FileDescriptor::seek(off_t offset, int whence)
|
||||
{
|
||||
ASSERT(!is_fifo());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue