mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Kernel: Convert process file descriptor table to a SpinlockProtected
Instead of manually locking in the various member functions of Process::OpenFileDescriptions, simply wrap it in a SpinlockProtected.
This commit is contained in:
parent
93e90e16c3
commit
8ebec2938c
30 changed files with 257 additions and 190 deletions
|
@ -15,7 +15,7 @@ ErrorOr<FlatPtr> Process::sys$ttyname(int fd, Userspace<char*> buffer, size_t si
|
|||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
TRY(require_promise(Pledge::tty));
|
||||
auto description = TRY(fds().open_file_description(fd));
|
||||
auto description = TRY(open_file_description(fd));
|
||||
if (!description->is_tty())
|
||||
return ENOTTY;
|
||||
auto const& tty_name = description->tty()->tty_name();
|
||||
|
@ -29,7 +29,7 @@ ErrorOr<FlatPtr> Process::sys$ptsname(int fd, Userspace<char*> buffer, size_t si
|
|||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
TRY(require_promise(Pledge::tty));
|
||||
auto description = TRY(fds().open_file_description(fd));
|
||||
auto description = TRY(open_file_description(fd));
|
||||
auto* master_pty = description->master_pty();
|
||||
if (!master_pty)
|
||||
return ENOTTY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue