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.
This commit is contained in:
Liav A 2021-06-22 21:22:17 +03:00 committed by Andreas Kling
commit 7c87891c06
Notes: sideshowbarker 2024-07-18 11:16:32 +09:00
28 changed files with 198 additions and 128 deletions

View file

@ -12,7 +12,7 @@ namespace Kernel {
KResultOr<FlatPtr> Process::sys$lseek(int fd, Userspace<off_t*> userspace_offset, int whence)
{
REQUIRE_PROMISE(stdio);
auto description = file_description(fd);
auto description = fds().file_description(fd);
if (!description)
return EBADF;
off_t offset;