mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 23:14:59 +00:00
Kernel: Rename FileDescriptor to FileDescription.
After reading a bunch of POSIX specs, I've learned that a file descriptor is the number that refers to a file description, not the description itself. So this patch renames FileDescriptor to FileDescription, and Process now has FileDescription* file_description(int fd).
This commit is contained in:
parent
69a6ce90df
commit
08cd75ac4b
70 changed files with 373 additions and 373 deletions
|
@ -1,6 +1,6 @@
|
|||
#include <Kernel/FileSystem/InodeFile.h>
|
||||
#include <Kernel/FileSystem/Inode.h>
|
||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
|
@ -13,17 +13,17 @@ InodeFile::~InodeFile()
|
|||
{
|
||||
}
|
||||
|
||||
ssize_t InodeFile::read(FileDescriptor& descriptor, byte* buffer, ssize_t count)
|
||||
ssize_t InodeFile::read(FileDescription& descriptor, byte* buffer, ssize_t count)
|
||||
{
|
||||
return m_inode->read_bytes(descriptor.offset(), count, buffer, &descriptor);
|
||||
}
|
||||
|
||||
ssize_t InodeFile::write(FileDescriptor& descriptor, const byte* data, ssize_t count)
|
||||
ssize_t InodeFile::write(FileDescription& descriptor, const byte* data, ssize_t count)
|
||||
{
|
||||
return m_inode->write_bytes(descriptor.offset(), count, data, &descriptor);
|
||||
}
|
||||
|
||||
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescriptor& descriptor, LinearAddress preferred_laddr, size_t offset, size_t size, int prot)
|
||||
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptor, LinearAddress preferred_laddr, size_t offset, size_t size, int prot)
|
||||
{
|
||||
ASSERT(offset == 0);
|
||||
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
|
||||
|
@ -34,7 +34,7 @@ KResultOr<Region*> InodeFile::mmap(Process& process, FileDescriptor& descriptor,
|
|||
return region;
|
||||
}
|
||||
|
||||
String InodeFile::absolute_path(const FileDescriptor& descriptor) const
|
||||
String InodeFile::absolute_path(const FileDescription& descriptor) const
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
ASSERT(descriptor.custody());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue