diff options
author | Liav A <liavalb@gmail.com> | 2021-06-22 21:22:17 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-29 20:53:59 +0200 |
commit | 7c87891c06e37f217b5fde17a3fc869306da659b (patch) | |
tree | 3017e40cfb6fbbd01e1f0b36b483003d498c189c /Kernel/Syscalls/write.cpp | |
parent | 12b6e6915034a0c0d1981caf419a35c0a8cd247e (diff) | |
download | serenity-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.cpp | 4 |
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()) |