summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/write.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-06-22 21:22:17 +0300
committerAndreas Kling <kling@serenityos.org>2021-06-29 20:53:59 +0200
commit7c87891c06e37f217b5fde17a3fc869306da659b (patch)
tree3017e40cfb6fbbd01e1f0b36b483003d498c189c /Kernel/Syscalls/write.cpp
parent12b6e6915034a0c0d1981caf419a35c0a8cd247e (diff)
downloadserenity-7c87891c06e37f217b5fde17a3fc869306da659b.zip
Kernel: Don't copy a Vector<FileDescriptionAndFlags>
Instead of copying a Vector everytime we need to enumerate a Process' file descriptions, we can just temporarily lock so it won't change.
Diffstat (limited to 'Kernel/Syscalls/write.cpp')
-rw-r--r--Kernel/Syscalls/write.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/write.cpp b/Kernel/Syscalls/write.cpp
index fece780d9c..2ede957a53 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 = file_description(fd);
+ auto description = fds().file_description(fd);
if (!description)
return EBADF;
@@ -105,7 +105,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 = file_description(fd);
+ auto description = fds().file_description(fd);
if (!description)
return EBADF;
if (!description->is_writable())