mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
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:
parent
12b6e69150
commit
7c87891c06
28 changed files with 198 additions and 128 deletions
|
@ -14,7 +14,7 @@ namespace Kernel {
|
|||
KResultOr<FlatPtr> Process::sys$ttyname(int fd, Userspace<char*> buffer, size_t size)
|
||||
{
|
||||
REQUIRE_PROMISE(tty);
|
||||
auto description = file_description(fd);
|
||||
auto description = fds().file_description(fd);
|
||||
if (!description)
|
||||
return EBADF;
|
||||
if (!description->is_tty())
|
||||
|
@ -30,7 +30,7 @@ KResultOr<FlatPtr> Process::sys$ttyname(int fd, Userspace<char*> buffer, size_t
|
|||
KResultOr<FlatPtr> Process::sys$ptsname(int fd, Userspace<char*> buffer, size_t size)
|
||||
{
|
||||
REQUIRE_PROMISE(tty);
|
||||
auto description = file_description(fd);
|
||||
auto description = fds().file_description(fd);
|
||||
if (!description)
|
||||
return EBADF;
|
||||
auto* master_pty = description->master_pty();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue