summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-07 13:41:27 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-07 13:53:14 +0200
commit213b8868af6028c98cf96b0a668fc3dda8ba5958 (patch)
tree963f56fa4fa4a6ce3e5ada4316825513562a72fc
parent4a9c18afb9b9c7fde698e93700e661d66e3ed34d (diff)
downloadserenity-213b8868af6028c98cf96b0a668fc3dda8ba5958.zip
Kernel: Rename file_description(fd) => open_file_description(fd)
To go with the class rename.
-rw-r--r--Kernel/Process.cpp2
-rw-r--r--Kernel/Process.h2
-rw-r--r--Kernel/ProcessSpecificExposed.cpp2
-rw-r--r--Kernel/Syscalls/chdir.cpp2
-rw-r--r--Kernel/Syscalls/chmod.cpp2
-rw-r--r--Kernel/Syscalls/chown.cpp2
-rw-r--r--Kernel/Syscalls/dup2.cpp2
-rw-r--r--Kernel/Syscalls/fcntl.cpp2
-rw-r--r--Kernel/Syscalls/ftruncate.cpp2
-rw-r--r--Kernel/Syscalls/get_dir_entries.cpp2
-rw-r--r--Kernel/Syscalls/inode_watcher.cpp4
-rw-r--r--Kernel/Syscalls/ioctl.cpp2
-rw-r--r--Kernel/Syscalls/lseek.cpp2
-rw-r--r--Kernel/Syscalls/mmap.cpp2
-rw-r--r--Kernel/Syscalls/mount.cpp2
-rw-r--r--Kernel/Syscalls/open.cpp4
-rw-r--r--Kernel/Syscalls/read.cpp4
-rw-r--r--Kernel/Syscalls/select.cpp4
-rw-r--r--Kernel/Syscalls/sendfd.cpp6
-rw-r--r--Kernel/Syscalls/socket.cpp20
-rw-r--r--Kernel/Syscalls/stat.cpp4
-rw-r--r--Kernel/Syscalls/statvfs.cpp2
-rw-r--r--Kernel/Syscalls/ttyname.cpp4
-rw-r--r--Kernel/Syscalls/write.cpp4
24 files changed, 42 insertions, 42 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 1c81669524..466f382592 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -451,7 +451,7 @@ Process::OpenFileDescriptionAndFlags& Process::OpenFileDescriptions::at(size_t i
return m_fds_metadatas[i];
}
-KResultOr<NonnullRefPtr<OpenFileDescription>> Process::OpenFileDescriptions::file_description(int fd) const
+KResultOr<NonnullRefPtr<OpenFileDescription>> Process::OpenFileDescriptions::open_file_description(int fd) const
{
SpinlockLocker lock(m_fds_lock);
if (fd < 0)
diff --git a/Kernel/Process.h b/Kernel/Process.h
index 5ae676bcfb..751be9596d 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -676,7 +676,7 @@ public:
m_fds_metadatas.clear();
}
- KResultOr<NonnullRefPtr<OpenFileDescription>> file_description(int fd) const;
+ KResultOr<NonnullRefPtr<OpenFileDescription>> open_file_description(int fd) const;
private:
OpenFileDescriptions() = default;
diff --git a/Kernel/ProcessSpecificExposed.cpp b/Kernel/ProcessSpecificExposed.cpp
index 5f649b4974..d5ae45b7b5 100644
--- a/Kernel/ProcessSpecificExposed.cpp
+++ b/Kernel/ProcessSpecificExposed.cpp
@@ -79,7 +79,7 @@ KResultOr<NonnullRefPtr<Inode>> Process::lookup_stacks_directory(const ProcFS& p
KResultOr<size_t> Process::procfs_get_file_description_link(unsigned fd, KBufferBuilder& builder) const
{
- auto file_description = TRY(m_fds.file_description(fd));
+ auto file_description = TRY(m_fds.open_file_description(fd));
auto data = file_description->absolute_path();
TRY(builder.append(data));
return data.length();
diff --git a/Kernel/Syscalls/chdir.cpp b/Kernel/Syscalls/chdir.cpp
index 327da07a36..2af24a3565 100644
--- a/Kernel/Syscalls/chdir.cpp
+++ b/Kernel/Syscalls/chdir.cpp
@@ -23,7 +23,7 @@ KResultOr<FlatPtr> Process::sys$fchdir(int fd)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
REQUIRE_PROMISE(stdio);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_directory())
return ENOTDIR;
if (!description->metadata().may_execute(*this))
diff --git a/Kernel/Syscalls/chmod.cpp b/Kernel/Syscalls/chmod.cpp
index 8cc9b8a863..b66284fd59 100644
--- a/Kernel/Syscalls/chmod.cpp
+++ b/Kernel/Syscalls/chmod.cpp
@@ -22,7 +22,7 @@ KResultOr<FlatPtr> Process::sys$fchmod(int fd, mode_t mode)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
REQUIRE_PROMISE(fattr);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
return description->chmod(mode);
}
diff --git a/Kernel/Syscalls/chown.cpp b/Kernel/Syscalls/chown.cpp
index a76dcafa5d..3e2fe6aaca 100644
--- a/Kernel/Syscalls/chown.cpp
+++ b/Kernel/Syscalls/chown.cpp
@@ -13,7 +13,7 @@ KResultOr<FlatPtr> Process::sys$fchown(int fd, UserID uid, GroupID gid)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
REQUIRE_PROMISE(chown);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
return description->chown(uid, gid);
}
diff --git a/Kernel/Syscalls/dup2.cpp b/Kernel/Syscalls/dup2.cpp
index 72d6aa7438..22cd74123a 100644
--- a/Kernel/Syscalls/dup2.cpp
+++ b/Kernel/Syscalls/dup2.cpp
@@ -13,7 +13,7 @@ KResultOr<FlatPtr> Process::sys$dup2(int old_fd, int new_fd)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
REQUIRE_PROMISE(stdio);
- auto description = TRY(fds().file_description(old_fd));
+ auto description = TRY(fds().open_file_description(old_fd));
if (old_fd == new_fd)
return new_fd;
if (new_fd < 0 || static_cast<size_t>(new_fd) >= fds().max_open())
diff --git a/Kernel/Syscalls/fcntl.cpp b/Kernel/Syscalls/fcntl.cpp
index acb9c30ec8..ed5da4e975 100644
--- a/Kernel/Syscalls/fcntl.cpp
+++ b/Kernel/Syscalls/fcntl.cpp
@@ -15,7 +15,7 @@ KResultOr<FlatPtr> Process::sys$fcntl(int fd, int cmd, u32 arg)
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
REQUIRE_PROMISE(stdio);
dbgln_if(IO_DEBUG, "sys$fcntl: fd={}, cmd={}, arg={}", fd, cmd, arg);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
// NOTE: The FD flags are not shared between OpenFileDescription objects.
// This means that dup() doesn't copy the FD_CLOEXEC flag!
switch (cmd) {
diff --git a/Kernel/Syscalls/ftruncate.cpp b/Kernel/Syscalls/ftruncate.cpp
index b2a29b18b3..050da17410 100644
--- a/Kernel/Syscalls/ftruncate.cpp
+++ b/Kernel/Syscalls/ftruncate.cpp
@@ -17,7 +17,7 @@ KResultOr<FlatPtr> Process::sys$ftruncate(int fd, Userspace<off_t*> userspace_le
TRY(copy_from_user(&length, userspace_length));
if (length < 0)
return EINVAL;
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_writable())
return EBADF;
return description->truncate(static_cast<u64>(length));
diff --git a/Kernel/Syscalls/get_dir_entries.cpp b/Kernel/Syscalls/get_dir_entries.cpp
index 604def772d..49e0fba98e 100644
--- a/Kernel/Syscalls/get_dir_entries.cpp
+++ b/Kernel/Syscalls/get_dir_entries.cpp
@@ -15,7 +15,7 @@ KResultOr<FlatPtr> Process::sys$get_dir_entries(int fd, Userspace<void*> user_bu
REQUIRE_PROMISE(stdio);
if (user_size > NumericLimits<ssize_t>::max())
return EINVAL;
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
auto buffer = UserOrKernelBuffer::for_user_buffer(user_buffer, static_cast<size_t>(user_size));
if (!buffer.has_value())
return EFAULT;
diff --git a/Kernel/Syscalls/inode_watcher.cpp b/Kernel/Syscalls/inode_watcher.cpp
index 08dbdb3189..b118d10d53 100644
--- a/Kernel/Syscalls/inode_watcher.cpp
+++ b/Kernel/Syscalls/inode_watcher.cpp
@@ -40,7 +40,7 @@ KResultOr<FlatPtr> Process::sys$inode_watcher_add_watch(Userspace<const Syscall:
REQUIRE_PROMISE(rpath);
auto params = TRY(copy_typed_from_user(user_params));
- auto description = TRY(fds().file_description(params.fd));
+ auto description = TRY(fds().open_file_description(params.fd));
if (!description->is_inode_watcher())
return EBADF;
auto inode_watcher = description->inode_watcher();
@@ -55,7 +55,7 @@ KResultOr<FlatPtr> Process::sys$inode_watcher_add_watch(Userspace<const Syscall:
KResultOr<FlatPtr> Process::sys$inode_watcher_remove_watch(int fd, int wd)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_inode_watcher())
return EBADF;
return description->inode_watcher()->unregister_by_wd(wd);
diff --git a/Kernel/Syscalls/ioctl.cpp b/Kernel/Syscalls/ioctl.cpp
index c3a4dc1277..b5b078186e 100644
--- a/Kernel/Syscalls/ioctl.cpp
+++ b/Kernel/Syscalls/ioctl.cpp
@@ -13,7 +13,7 @@ namespace Kernel {
KResultOr<FlatPtr> Process::sys$ioctl(int fd, unsigned request, FlatPtr arg)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (request == FIONBIO) {
description->set_blocking(arg == 0);
return KSuccess;
diff --git a/Kernel/Syscalls/lseek.cpp b/Kernel/Syscalls/lseek.cpp
index aa6ee1ce6d..5f484d5f24 100644
--- a/Kernel/Syscalls/lseek.cpp
+++ b/Kernel/Syscalls/lseek.cpp
@@ -13,7 +13,7 @@ KResultOr<FlatPtr> Process::sys$lseek(int fd, Userspace<off_t*> userspace_offset
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
off_t offset;
TRY(copy_from_user(&offset, userspace_offset));
auto seek_result = TRY(description->seek(offset, whence));
diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp
index bd4ad2e642..ace935c8b8 100644
--- a/Kernel/Syscalls/mmap.cpp
+++ b/Kernel/Syscalls/mmap.cpp
@@ -221,7 +221,7 @@ KResultOr<FlatPtr> Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> u
return EINVAL;
if (static_cast<size_t>(offset) & ~PAGE_MASK)
return EINVAL;
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (description->is_directory())
return ENODEV;
// Require read access even when read protection is not requested.
diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp
index aa28dfb520..2844839ddf 100644
--- a/Kernel/Syscalls/mount.cpp
+++ b/Kernel/Syscalls/mount.cpp
@@ -32,7 +32,7 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
auto fs_type_string = TRY(try_copy_kstring_from_user(params.fs_type));
auto fs_type = fs_type_string->view();
- auto description_or_error = fds().file_description(source_fd);
+ auto description_or_error = fds().open_file_description(source_fd);
if (!description_or_error.is_error())
dbgln("mount {}: source fd {} @ {}", fs_type, source_fd, target);
else
diff --git a/Kernel/Syscalls/open.cpp b/Kernel/Syscalls/open.cpp
index 100a077931..9dd7061505 100644
--- a/Kernel/Syscalls/open.cpp
+++ b/Kernel/Syscalls/open.cpp
@@ -46,7 +46,7 @@ KResultOr<FlatPtr> Process::sys$open(Userspace<const Syscall::SC_open_params*> u
if (dirfd == AT_FDCWD) {
base = current_directory();
} else {
- auto base_description = TRY(fds().file_description(dirfd));
+ auto base_description = TRY(fds().open_file_description(dirfd));
if (!base_description->is_directory())
return ENOTDIR;
if (!base_description->custody())
@@ -68,7 +68,7 @@ KResultOr<FlatPtr> Process::sys$close(int fd)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
auto result = description->close();
m_fds[fd] = {};
return result;
diff --git a/Kernel/Syscalls/read.cpp b/Kernel/Syscalls/read.cpp
index b57f7712ba..888aca9b1d 100644
--- a/Kernel/Syscalls/read.cpp
+++ b/Kernel/Syscalls/read.cpp
@@ -34,7 +34,7 @@ KResultOr<FlatPtr> Process::sys$readv(int fd, Userspace<const struct iovec*> iov
return EINVAL;
}
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_readable())
return EBADF;
if (description->is_directory())
@@ -71,7 +71,7 @@ KResultOr<FlatPtr> Process::sys$read(int fd, Userspace<u8*> buffer, size_t size)
if (size > NumericLimits<ssize_t>::max())
return EINVAL;
dbgln_if(IO_DEBUG, "sys$read({}, {}, {})", fd, buffer.ptr(), size);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_readable())
return EBADF;
if (description->is_directory())
diff --git a/Kernel/Syscalls/select.cpp b/Kernel/Syscalls/select.cpp
index 8f403f3a32..2073e5c1ea 100644
--- a/Kernel/Syscalls/select.cpp
+++ b/Kernel/Syscalls/select.cpp
@@ -71,7 +71,7 @@ KResultOr<FlatPtr> Process::sys$select(Userspace<const Syscall::SC_select_params
if (block_flags == BlockFlags::None)
continue;
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!fds_info.try_append({ move(description), block_flags }))
return ENOMEM;
if (!selected_fds.try_append(fd))
@@ -154,7 +154,7 @@ KResultOr<FlatPtr> Process::sys$poll(Userspace<const Syscall::SC_poll_params*> u
Thread::SelectBlocker::FDVector fds_info;
for (size_t i = 0; i < params.nfds; i++) {
auto& pfd = fds_copy[i];
- auto description = TRY(fds().file_description(pfd.fd));
+ auto description = TRY(fds().open_file_description(pfd.fd));
BlockFlags block_flags = BlockFlags::Exception; // always want POLLERR, POLLHUP, POLLNVAL
if (pfd.events & POLLIN)
block_flags |= BlockFlags::Read;
diff --git a/Kernel/Syscalls/sendfd.cpp b/Kernel/Syscalls/sendfd.cpp
index b6e8c4f87a..ea77b41bc9 100644
--- a/Kernel/Syscalls/sendfd.cpp
+++ b/Kernel/Syscalls/sendfd.cpp
@@ -14,7 +14,7 @@ KResultOr<FlatPtr> Process::sys$sendfd(int sockfd, int fd)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(sendfd);
- auto socket_description = TRY(fds().file_description(sockfd));
+ auto socket_description = TRY(fds().open_file_description(sockfd));
if (!socket_description->is_socket())
return ENOTSOCK;
auto& socket = *socket_description->socket();
@@ -23,7 +23,7 @@ KResultOr<FlatPtr> Process::sys$sendfd(int sockfd, int fd)
if (!socket.is_connected())
return ENOTCONN;
- auto passing_descriptor = TRY(fds().file_description(fd));
+ auto passing_descriptor = TRY(fds().open_file_description(fd));
auto& local_socket = static_cast<LocalSocket&>(socket);
return local_socket.sendfd(*socket_description, *passing_descriptor);
}
@@ -32,7 +32,7 @@ KResultOr<FlatPtr> Process::sys$recvfd(int sockfd, int options)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(recvfd);
- auto socket_description = TRY(fds().file_description(sockfd));
+ auto socket_description = TRY(fds().open_file_description(sockfd));
if (!socket_description->is_socket())
return ENOTSOCK;
auto& socket = *socket_description->socket();
diff --git a/Kernel/Syscalls/socket.cpp b/Kernel/Syscalls/socket.cpp
index d023b69e75..d06664de7f 100644
--- a/Kernel/Syscalls/socket.cpp
+++ b/Kernel/Syscalls/socket.cpp
@@ -48,7 +48,7 @@ KResultOr<FlatPtr> Process::sys$socket(int domain, int type, int protocol)
KResultOr<FlatPtr> Process::sys$bind(int sockfd, Userspace<const sockaddr*> address, socklen_t address_length)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -61,7 +61,7 @@ KResultOr<FlatPtr> Process::sys$listen(int sockfd, int backlog)
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
if (backlog < 0)
return EINVAL;
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -88,7 +88,7 @@ KResultOr<FlatPtr> Process::sys$accept4(Userspace<const Syscall::SC_accept4_para
}
auto fd_allocation = TRY(m_fds.allocate());
- auto accepting_socket_description = TRY(fds().file_description(accepting_socket_fd));
+ auto accepting_socket_description = TRY(fds().open_file_description(accepting_socket_fd));
if (!accepting_socket_description->is_socket())
return ENOTSOCK;
auto& socket = *accepting_socket_description->socket();
@@ -132,7 +132,7 @@ KResultOr<FlatPtr> Process::sys$accept4(Userspace<const Syscall::SC_accept4_para
KResultOr<FlatPtr> Process::sys$connect(int sockfd, Userspace<const sockaddr*> user_address, socklen_t user_address_size)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -146,7 +146,7 @@ KResultOr<FlatPtr> Process::sys$shutdown(int sockfd, int how)
REQUIRE_PROMISE(stdio);
if (how & ~SHUT_RDWR)
return EINVAL;
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -173,7 +173,7 @@ KResultOr<FlatPtr> Process::sys$sendmsg(int sockfd, Userspace<const struct msghd
Userspace<const sockaddr*> user_addr((FlatPtr)msg.msg_name);
socklen_t addr_length = msg.msg_namelen;
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -207,7 +207,7 @@ KResultOr<FlatPtr> Process::sys$recvmsg(int sockfd, Userspace<struct msghdr*> us
Userspace<sockaddr*> user_addr((FlatPtr)msg.msg_name);
Userspace<socklen_t*> user_addr_length(msg.msg_name ? (FlatPtr)&user_msg.unsafe_userspace_ptr()->msg_namelen : 0);
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -265,7 +265,7 @@ KResult Process::get_sock_or_peer_name(const Params& params)
if (addrlen_value <= 0)
return EINVAL;
- auto description = TRY(fds().file_description(params.sockfd));
+ auto description = TRY(fds().open_file_description(params.sockfd));
if (!description->is_socket())
return ENOTSOCK;
@@ -310,7 +310,7 @@ KResultOr<FlatPtr> Process::sys$getsockopt(Userspace<const Syscall::SC_getsockop
socklen_t value_size;
TRY(copy_from_user(&value_size, params.value_size, sizeof(socklen_t)));
- auto description = TRY(fds().file_description(sockfd));
+ auto description = TRY(fds().open_file_description(sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
@@ -324,7 +324,7 @@ KResultOr<FlatPtr> Process::sys$setsockopt(Userspace<const Syscall::SC_setsockop
auto params = TRY(copy_typed_from_user(user_params));
Userspace<const void*> user_value((FlatPtr)params.value);
- auto description = TRY(fds().file_description(params.sockfd));
+ auto description = TRY(fds().open_file_description(params.sockfd));
if (!description->is_socket())
return ENOTSOCK;
auto& socket = *description->socket();
diff --git a/Kernel/Syscalls/stat.cpp b/Kernel/Syscalls/stat.cpp
index 31d0cd9c6e..8751d9e3a8 100644
--- a/Kernel/Syscalls/stat.cpp
+++ b/Kernel/Syscalls/stat.cpp
@@ -15,7 +15,7 @@ KResultOr<FlatPtr> Process::sys$fstat(int fd, Userspace<stat*> user_statbuf)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
stat buffer = {};
TRY(description->stat(buffer));
return copy_to_user(user_statbuf, &buffer);
@@ -33,7 +33,7 @@ KResultOr<FlatPtr> Process::sys$stat(Userspace<const Syscall::SC_stat_params*> u
if (params.dirfd == AT_FDCWD) {
base = current_directory();
} else {
- auto base_description = TRY(fds().file_description(params.dirfd));
+ auto base_description = TRY(fds().open_file_description(params.dirfd));
if (!base_description->is_directory())
return ENOTDIR;
if (!base_description->custody())
diff --git a/Kernel/Syscalls/statvfs.cpp b/Kernel/Syscalls/statvfs.cpp
index f5c5c8baee..ed2a70dfa9 100644
--- a/Kernel/Syscalls/statvfs.cpp
+++ b/Kernel/Syscalls/statvfs.cpp
@@ -76,7 +76,7 @@ KResultOr<FlatPtr> Process::sys$fstatvfs(int fd, statvfs* buf)
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
return do_statvfs(description->absolute_path(), buf);
}
diff --git a/Kernel/Syscalls/ttyname.cpp b/Kernel/Syscalls/ttyname.cpp
index e7b3871b59..ca4df4de74 100644
--- a/Kernel/Syscalls/ttyname.cpp
+++ b/Kernel/Syscalls/ttyname.cpp
@@ -15,7 +15,7 @@ KResultOr<FlatPtr> Process::sys$ttyname(int fd, Userspace<char*> buffer, size_t
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(tty);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_tty())
return ENOTTY;
auto tty_name = description->tty()->tty_name();
@@ -28,7 +28,7 @@ KResultOr<FlatPtr> Process::sys$ptsname(int fd, Userspace<char*> buffer, size_t
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(tty);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
auto* master_pty = description->master_pty();
if (!master_pty)
return ENOTTY;
diff --git a/Kernel/Syscalls/write.cpp b/Kernel/Syscalls/write.cpp
index 14154f638e..6a94b0fa9b 100644
--- a/Kernel/Syscalls/write.cpp
+++ b/Kernel/Syscalls/write.cpp
@@ -33,7 +33,7 @@ KResultOr<FlatPtr> Process::sys$writev(int fd, Userspace<const struct iovec*> io
return EINVAL;
}
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_writable())
return EBADF;
@@ -101,7 +101,7 @@ KResultOr<FlatPtr> Process::sys$write(int fd, Userspace<const u8*> data, size_t
return EINVAL;
dbgln_if(IO_DEBUG, "sys$write({}, {}, {})", fd, data.ptr(), size);
- auto description = TRY(fds().file_description(fd));
+ auto description = TRY(fds().open_file_description(fd));
if (!description->is_writable())
return EBADF;