mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 23:04: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,5 +1,5 @@
|
|||
#include "VirtualFileSystem.h"
|
||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include "FileSystem.h"
|
||||
#include <AK/FileSystemPath.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
|
@ -149,7 +149,7 @@ KResult VFS::stat(StringView path, int options, Custody& base, struct stat& stat
|
|||
return custody_or_error.value()->inode().metadata().stat(statbuf);
|
||||
}
|
||||
|
||||
KResultOr<Retained<FileDescriptor>> VFS::open(StringView path, int options, mode_t mode, Custody& base)
|
||||
KResultOr<Retained<FileDescription>> VFS::open(StringView path, int options, mode_t mode, Custody& base)
|
||||
{
|
||||
auto custody_or_error = resolve_path(path, base, nullptr, options);
|
||||
if (options & O_CREAT) {
|
||||
|
@ -194,7 +194,7 @@ KResultOr<Retained<FileDescriptor>> VFS::open(StringView path, int options, mode
|
|||
}
|
||||
if (should_truncate_file)
|
||||
inode.truncate(0);
|
||||
return FileDescriptor::create(custody);
|
||||
return FileDescription::create(custody);
|
||||
}
|
||||
|
||||
KResult VFS::mknod(StringView path, mode_t mode, dev_t dev, Custody& base)
|
||||
|
@ -224,7 +224,7 @@ KResult VFS::mknod(StringView path, mode_t mode, dev_t dev, Custody& base)
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
KResultOr<Retained<FileDescriptor>> VFS::create(StringView path, int options, mode_t mode, Custody& base)
|
||||
KResultOr<Retained<FileDescription>> VFS::create(StringView path, int options, mode_t mode, Custody& base)
|
||||
{
|
||||
(void)options;
|
||||
|
||||
|
@ -253,7 +253,7 @@ KResultOr<Retained<FileDescriptor>> VFS::create(StringView path, int options, mo
|
|||
return KResult(error);
|
||||
|
||||
auto new_custody = Custody::create(parent_custody, p.basename(), *new_file);
|
||||
return FileDescriptor::create(*new_custody);
|
||||
return FileDescription::create(*new_custody);
|
||||
}
|
||||
|
||||
KResult VFS::mkdir(StringView path, mode_t mode, Custody& base)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue