2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2020-09-15 13:24:14 +03:00
|
|
|
#include <AK/MemoryStream.h>
|
2019-05-30 14:39:17 +03:00
|
|
|
#include <Kernel/Devices/BlockDevice.h>
|
|
|
|
#include <Kernel/Devices/CharacterDevice.h>
|
2019-05-30 19:58:59 +03:00
|
|
|
#include <Kernel/FileSystem/Custody.h>
|
2019-04-06 21:29:48 +03:00
|
|
|
#include <Kernel/FileSystem/FIFO.h>
|
2019-06-07 10:36:51 +03:00
|
|
|
#include <Kernel/FileSystem/FileDescription.h>
|
2019-05-30 14:39:17 +03:00
|
|
|
#include <Kernel/FileSystem/FileSystem.h>
|
|
|
|
#include <Kernel/FileSystem/InodeFile.h>
|
2019-04-06 21:29:48 +03:00
|
|
|
#include <Kernel/Net/Socket.h>
|
2019-02-16 11:57:42 +03:00
|
|
|
#include <Kernel/Process.h>
|
2019-05-30 14:39:17 +03:00
|
|
|
#include <Kernel/TTY/MasterPTY.h>
|
|
|
|
#include <Kernel/TTY/TTY.h>
|
|
|
|
#include <Kernel/UnixTypes.h>
|
|
|
|
#include <Kernel/VM/MemoryManager.h>
|
|
|
|
#include <LibC/errno_numbers.h>
|
2018-11-07 14:05:51 +03:00
|
|
|
|
2020-02-16 03:27:42 +03:00
|
|
|
namespace Kernel {
|
|
|
|
|
2019-08-11 10:32:21 +03:00
|
|
|
NonnullRefPtr<FileDescription> FileDescription::create(Custody& custody)
|
2018-11-05 21:01:22 +03:00
|
|
|
{
|
2019-08-11 10:32:21 +03:00
|
|
|
auto description = adopt(*new FileDescription(InodeFile::create(custody.inode())));
|
|
|
|
description->m_custody = custody;
|
2019-06-13 23:03:04 +03:00
|
|
|
return description;
|
2019-01-16 14:57:07 +03:00
|
|
|
}
|
|
|
|
|
2019-08-11 16:38:20 +03:00
|
|
|
NonnullRefPtr<FileDescription> FileDescription::create(File& file)
|
2019-01-16 14:57:07 +03:00
|
|
|
{
|
2019-08-11 16:38:20 +03:00
|
|
|
return adopt(*new FileDescription(file));
|
2019-02-14 16:17:38 +03:00
|
|
|
}
|
|
|
|
|
2019-08-11 16:38:20 +03:00
|
|
|
FileDescription::FileDescription(File& file)
|
2019-08-11 10:32:21 +03:00
|
|
|
: m_file(file)
|
2019-02-14 16:17:38 +03:00
|
|
|
{
|
2019-08-11 10:32:21 +03:00
|
|
|
if (file.is_inode())
|
|
|
|
m_inode = static_cast<InodeFile&>(file).inode();
|
2019-08-11 16:28:18 +03:00
|
|
|
if (is_socket())
|
|
|
|
socket()->attach(*this);
|
2019-10-25 10:22:22 +03:00
|
|
|
m_is_directory = metadata().is_directory();
|
2019-02-14 16:17:38 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
FileDescription::~FileDescription()
|
2018-10-10 12:53:07 +03:00
|
|
|
{
|
2019-05-03 21:42:43 +03:00
|
|
|
if (is_socket())
|
|
|
|
socket()->detach(*this);
|
2019-04-29 05:55:54 +03:00
|
|
|
if (is_fifo())
|
|
|
|
static_cast<FIFO*>(m_file.ptr())->detach(m_fifo_direction);
|
2020-08-05 12:13:30 +03:00
|
|
|
// FIXME: Should this error path be observed somehow?
|
|
|
|
(void)m_file->close();
|
2019-01-30 20:26:19 +03:00
|
|
|
m_inode = nullptr;
|
2018-10-10 12:53:07 +03:00
|
|
|
}
|
|
|
|
|
2020-09-06 19:17:07 +03:00
|
|
|
KResult FileDescription::stat(::stat& buffer)
|
2018-10-14 23:57:41 +03:00
|
|
|
{
|
2020-09-06 19:31:51 +03:00
|
|
|
LOCKER(m_lock);
|
|
|
|
// FIXME: This is a little awkward, why can't we always forward to File::stat()?
|
|
|
|
if (m_inode)
|
|
|
|
return metadata().stat(buffer);
|
|
|
|
return m_file->stat(buffer);
|
2018-10-14 23:57:41 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
off_t FileDescription::seek(off_t offset, int whence)
|
2018-10-14 22:19:27 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2019-05-30 14:39:17 +03:00
|
|
|
if (!m_file->is_seekable())
|
2020-05-22 19:33:57 +03:00
|
|
|
return -ESPIPE;
|
2018-10-14 22:19:27 +03:00
|
|
|
|
2019-05-30 14:39:17 +03:00
|
|
|
off_t new_offset;
|
2018-10-14 22:19:27 +03:00
|
|
|
|
2018-10-14 23:57:41 +03:00
|
|
|
switch (whence) {
|
|
|
|
case SEEK_SET:
|
2019-05-30 14:39:17 +03:00
|
|
|
new_offset = offset;
|
2018-10-14 22:19:27 +03:00
|
|
|
break;
|
2018-10-14 23:57:41 +03:00
|
|
|
case SEEK_CUR:
|
2019-05-30 14:39:17 +03:00
|
|
|
new_offset = m_current_offset + offset;
|
2018-10-14 22:19:27 +03:00
|
|
|
break;
|
2018-10-14 23:57:41 +03:00
|
|
|
case SEEK_END:
|
2020-04-06 11:54:21 +03:00
|
|
|
if (!metadata().is_valid())
|
|
|
|
return -EIO;
|
|
|
|
new_offset = metadata().size;
|
2018-10-14 22:19:27 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2019-05-30 14:39:17 +03:00
|
|
|
if (new_offset < 0)
|
2019-05-16 16:44:01 +03:00
|
|
|
return -EINVAL;
|
2019-05-18 22:54:31 +03:00
|
|
|
// FIXME: Return -EINVAL if attempting to seek past the end of a seekable device.
|
2019-05-16 16:44:01 +03:00
|
|
|
|
2019-05-30 14:39:17 +03:00
|
|
|
m_current_offset = new_offset;
|
2018-12-03 02:39:25 +03:00
|
|
|
return m_current_offset;
|
2018-10-14 22:19:27 +03:00
|
|
|
}
|
|
|
|
|
2020-09-12 06:11:07 +03:00
|
|
|
KResultOr<size_t> FileDescription::read(UserOrKernelBuffer& buffer, size_t count)
|
2018-10-14 22:19:27 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2020-08-04 19:02:23 +03:00
|
|
|
Checked<size_t> new_offset = m_current_offset;
|
|
|
|
new_offset += count;
|
|
|
|
if (new_offset.has_overflow())
|
2020-01-12 22:15:53 +03:00
|
|
|
return -EOVERFLOW;
|
2020-08-04 19:02:23 +03:00
|
|
|
auto nread_or_error = m_file->read(*this, offset(), buffer, count);
|
|
|
|
if (!nread_or_error.is_error() && m_file->is_seekable())
|
|
|
|
m_current_offset += nread_or_error.value();
|
|
|
|
return nread_or_error;
|
2018-10-14 22:19:27 +03:00
|
|
|
}
|
|
|
|
|
2020-09-12 06:11:07 +03:00
|
|
|
KResultOr<size_t> FileDescription::write(const UserOrKernelBuffer& data, size_t size)
|
2018-10-30 17:33:37 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2020-08-04 19:02:23 +03:00
|
|
|
Checked<size_t> new_offset = m_current_offset;
|
|
|
|
new_offset += size;
|
|
|
|
if (new_offset.has_overflow())
|
2020-01-12 22:15:53 +03:00
|
|
|
return -EOVERFLOW;
|
2020-08-04 19:02:23 +03:00
|
|
|
auto nwritten_or_error = m_file->write(*this, offset(), data, size);
|
|
|
|
if (!nwritten_or_error.is_error() && m_file->is_seekable())
|
|
|
|
m_current_offset += nwritten_or_error.value();
|
|
|
|
return nwritten_or_error;
|
2018-10-30 17:33:37 +03:00
|
|
|
}
|
|
|
|
|
2019-07-19 14:19:47 +03:00
|
|
|
bool FileDescription::can_write() const
|
2018-11-12 03:28:46 +03:00
|
|
|
{
|
2020-04-10 12:44:42 +03:00
|
|
|
return m_file->can_write(*this, offset());
|
2018-11-12 03:28:46 +03:00
|
|
|
}
|
|
|
|
|
2019-07-19 14:19:47 +03:00
|
|
|
bool FileDescription::can_read() const
|
2018-10-25 14:07:59 +03:00
|
|
|
{
|
2020-04-10 12:44:42 +03:00
|
|
|
return m_file->can_read(*this, offset());
|
2018-10-25 14:07:59 +03:00
|
|
|
}
|
|
|
|
|
2020-08-11 20:47:24 +03:00
|
|
|
KResultOr<KBuffer> FileDescription::read_entire_file()
|
2018-10-10 12:53:07 +03:00
|
|
|
{
|
2019-04-28 16:02:55 +03:00
|
|
|
// HACK ALERT: (This entire function)
|
2019-05-30 14:39:17 +03:00
|
|
|
ASSERT(m_file->is_inode());
|
2019-01-16 14:57:07 +03:00
|
|
|
ASSERT(m_inode);
|
|
|
|
return m_inode->read_entire(this);
|
2018-10-10 12:53:07 +03:00
|
|
|
}
|
|
|
|
|
2020-09-12 06:11:07 +03:00
|
|
|
ssize_t FileDescription::get_dir_entries(UserOrKernelBuffer& buffer, ssize_t size)
|
2018-10-24 13:43:52 +03:00
|
|
|
{
|
2020-04-18 12:50:35 +03:00
|
|
|
LOCKER(m_lock, Lock::Mode::Shared);
|
2019-10-25 10:22:22 +03:00
|
|
|
if (!is_directory())
|
|
|
|
return -ENOTDIR;
|
|
|
|
|
2019-01-16 14:57:07 +03:00
|
|
|
auto metadata = this->metadata();
|
2019-01-31 19:31:23 +03:00
|
|
|
if (!metadata.is_valid())
|
2018-10-24 13:43:52 +03:00
|
|
|
return -EIO;
|
|
|
|
|
2020-02-20 14:54:15 +03:00
|
|
|
if (size < 0)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2020-05-23 16:27:33 +03:00
|
|
|
size_t size_to_allocate = max(static_cast<size_t>(PAGE_SIZE), static_cast<size_t>(metadata.size));
|
2019-03-20 20:31:12 +03:00
|
|
|
|
|
|
|
auto temp_buffer = ByteBuffer::create_uninitialized(size_to_allocate);
|
2020-09-15 13:24:14 +03:00
|
|
|
OutputMemoryStream stream { temp_buffer };
|
|
|
|
|
2020-08-29 21:25:01 +03:00
|
|
|
KResult result = VFS::the().traverse_directory_inode(*m_inode, [&stream, this](auto& entry) {
|
2019-07-03 22:17:35 +03:00
|
|
|
stream << (u32)entry.inode.index();
|
2020-08-29 21:25:01 +03:00
|
|
|
stream << m_inode->fs().internal_file_type_to_directory_entry_type(entry);
|
2020-08-18 13:41:27 +03:00
|
|
|
stream << (u32)entry.name.length();
|
2020-09-15 13:24:14 +03:00
|
|
|
stream << entry.name.bytes();
|
2018-10-24 13:43:52 +03:00
|
|
|
return true;
|
|
|
|
});
|
2020-08-05 12:07:31 +03:00
|
|
|
|
|
|
|
if (result.is_error())
|
2020-08-08 22:17:35 +03:00
|
|
|
return result;
|
2020-08-05 12:07:31 +03:00
|
|
|
|
2020-09-16 17:55:29 +03:00
|
|
|
if (stream.handle_recoverable_error())
|
2020-02-20 14:54:15 +03:00
|
|
|
return -EINVAL;
|
2018-10-24 15:28:22 +03:00
|
|
|
|
2020-09-15 13:24:14 +03:00
|
|
|
if (!buffer.write(stream.bytes()))
|
2020-09-12 06:11:07 +03:00
|
|
|
return -EFAULT;
|
2020-09-15 13:24:14 +03:00
|
|
|
|
|
|
|
return stream.size();
|
2018-10-24 13:43:52 +03:00
|
|
|
}
|
2019-01-16 14:57:07 +03:00
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
bool FileDescription::is_device() const
|
2019-04-28 16:02:55 +03:00
|
|
|
{
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->is_device();
|
2019-04-28 16:02:55 +03:00
|
|
|
}
|
|
|
|
|
2020-01-12 18:28:23 +03:00
|
|
|
const Device* FileDescription::device() const
|
|
|
|
{
|
|
|
|
if (!is_device())
|
|
|
|
return nullptr;
|
|
|
|
return static_cast<const Device*>(m_file.ptr());
|
|
|
|
}
|
|
|
|
|
|
|
|
Device* FileDescription::device()
|
|
|
|
{
|
|
|
|
if (!is_device())
|
|
|
|
return nullptr;
|
|
|
|
return static_cast<Device*>(m_file.ptr());
|
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
bool FileDescription::is_tty() const
|
2018-10-31 00:03:02 +03:00
|
|
|
{
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->is_tty();
|
2018-10-31 00:03:02 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
const TTY* FileDescription::tty() const
|
2018-10-31 00:03:02 +03:00
|
|
|
{
|
2019-01-16 14:57:07 +03:00
|
|
|
if (!is_tty())
|
2018-11-12 03:28:46 +03:00
|
|
|
return nullptr;
|
2019-04-28 16:02:55 +03:00
|
|
|
return static_cast<const TTY*>(m_file.ptr());
|
2018-10-31 00:03:02 +03:00
|
|
|
}
|
2018-11-01 16:00:28 +03:00
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
TTY* FileDescription::tty()
|
2018-11-02 15:14:25 +03:00
|
|
|
{
|
2019-01-16 14:57:07 +03:00
|
|
|
if (!is_tty())
|
2018-11-12 03:28:46 +03:00
|
|
|
return nullptr;
|
2019-04-28 16:02:55 +03:00
|
|
|
return static_cast<TTY*>(m_file.ptr());
|
2018-11-02 15:14:25 +03:00
|
|
|
}
|
2019-01-15 08:30:19 +03:00
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
bool FileDescription::is_master_pty() const
|
2019-01-15 08:30:19 +03:00
|
|
|
{
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->is_master_pty();
|
2019-01-15 08:30:19 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
const MasterPTY* FileDescription::master_pty() const
|
2019-01-15 08:30:19 +03:00
|
|
|
{
|
|
|
|
if (!is_master_pty())
|
|
|
|
return nullptr;
|
2019-04-28 16:02:55 +03:00
|
|
|
return static_cast<const MasterPTY*>(m_file.ptr());
|
2019-01-15 08:30:19 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
MasterPTY* FileDescription::master_pty()
|
2019-01-15 08:30:19 +03:00
|
|
|
{
|
|
|
|
if (!is_master_pty())
|
|
|
|
return nullptr;
|
2019-04-28 16:02:55 +03:00
|
|
|
return static_cast<MasterPTY*>(m_file.ptr());
|
2019-01-15 08:30:19 +03:00
|
|
|
}
|
2018-11-02 15:14:25 +03:00
|
|
|
|
2020-06-02 19:20:05 +03:00
|
|
|
KResult FileDescription::close()
|
2018-11-01 16:00:28 +03:00
|
|
|
{
|
2020-06-02 19:20:05 +03:00
|
|
|
if (m_file->ref_count() > 1)
|
|
|
|
return KSuccess;
|
|
|
|
return m_file->close();
|
2018-11-01 16:00:28 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
String FileDescription::absolute_path() const
|
2018-11-01 16:00:28 +03:00
|
|
|
{
|
2019-05-30 19:58:59 +03:00
|
|
|
if (m_custody)
|
|
|
|
return m_custody->absolute_path();
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->absolute_path(*this);
|
2018-11-01 16:00:28 +03:00
|
|
|
}
|
2018-11-12 03:28:46 +03:00
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
InodeMetadata FileDescription::metadata() const
|
2019-01-16 14:57:07 +03:00
|
|
|
{
|
|
|
|
if (m_inode)
|
|
|
|
return m_inode->metadata();
|
2019-06-07 12:43:58 +03:00
|
|
|
return {};
|
2019-01-16 14:57:07 +03:00
|
|
|
}
|
2019-02-16 11:57:42 +03:00
|
|
|
|
2020-02-28 22:47:27 +03:00
|
|
|
KResultOr<Region*> FileDescription::mmap(Process& process, VirtualAddress vaddr, size_t offset, size_t size, int prot, bool shared)
|
2019-02-16 11:57:42 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2020-02-28 22:47:27 +03:00
|
|
|
return m_file->mmap(process, *this, vaddr, offset, size, prot, shared);
|
2019-02-16 11:57:42 +03:00
|
|
|
}
|
|
|
|
|
2020-02-08 14:07:04 +03:00
|
|
|
KResult FileDescription::truncate(u64 length)
|
2019-04-09 02:10:00 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->truncate(length);
|
2019-04-09 02:10:00 +03:00
|
|
|
}
|
2019-04-28 23:31:31 +03:00
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
bool FileDescription::is_fifo() const
|
2019-04-29 05:55:54 +03:00
|
|
|
{
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->is_fifo();
|
2019-04-29 05:55:54 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
FIFO* FileDescription::fifo()
|
2019-04-29 05:55:54 +03:00
|
|
|
{
|
|
|
|
if (!is_fifo())
|
|
|
|
return nullptr;
|
|
|
|
return static_cast<FIFO*>(m_file.ptr());
|
|
|
|
}
|
2019-05-03 21:42:43 +03:00
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
bool FileDescription::is_socket() const
|
2019-05-03 21:42:43 +03:00
|
|
|
{
|
2019-05-30 14:39:17 +03:00
|
|
|
return m_file->is_socket();
|
2019-05-03 21:42:43 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
Socket* FileDescription::socket()
|
2019-05-03 21:42:43 +03:00
|
|
|
{
|
|
|
|
if (!is_socket())
|
|
|
|
return nullptr;
|
|
|
|
return static_cast<Socket*>(m_file.ptr());
|
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
const Socket* FileDescription::socket() const
|
2019-05-03 21:42:43 +03:00
|
|
|
{
|
|
|
|
if (!is_socket())
|
|
|
|
return nullptr;
|
|
|
|
return static_cast<const Socket*>(m_file.ptr());
|
|
|
|
}
|
2019-05-30 16:37:51 +03:00
|
|
|
|
2019-07-03 22:17:35 +03:00
|
|
|
void FileDescription::set_file_flags(u32 flags)
|
2019-05-30 16:37:51 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2019-05-30 16:37:51 +03:00
|
|
|
m_is_blocking = !(flags & O_NONBLOCK);
|
|
|
|
m_should_append = flags & O_APPEND;
|
2019-11-05 21:35:12 +03:00
|
|
|
m_direct = flags & O_DIRECT;
|
2019-05-30 16:37:51 +03:00
|
|
|
m_file_flags = flags;
|
|
|
|
}
|
2019-06-01 21:31:36 +03:00
|
|
|
|
2020-01-03 22:14:56 +03:00
|
|
|
KResult FileDescription::chmod(mode_t mode)
|
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2020-05-28 17:32:20 +03:00
|
|
|
return m_file->chmod(*this, mode);
|
2020-01-03 22:14:56 +03:00
|
|
|
}
|
|
|
|
|
2019-06-07 10:36:51 +03:00
|
|
|
KResult FileDescription::chown(uid_t uid, gid_t gid)
|
2019-06-01 21:31:36 +03:00
|
|
|
{
|
2020-01-12 22:09:44 +03:00
|
|
|
LOCKER(m_lock);
|
2020-05-28 17:32:20 +03:00
|
|
|
return m_file->chown(*this, uid, gid);
|
2019-06-01 21:31:36 +03:00
|
|
|
}
|
2020-02-16 03:27:42 +03:00
|
|
|
|
|
|
|
}
|