mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
Kernel: Move TTY subsystem to use KString instead of AK::String
This is minor progress on removing the `AK::String` API from the Kernel in the interest of improving OOM safety.
This commit is contained in:
parent
71f05c70b4
commit
9f6eabd73a
10 changed files with 36 additions and 27 deletions
|
@ -18,7 +18,7 @@ KResultOr<FlatPtr> Process::sys$ttyname(int fd, Userspace<char*> buffer, size_t
|
|||
auto description = TRY(fds().open_file_description(fd));
|
||||
if (!description->is_tty())
|
||||
return ENOTTY;
|
||||
auto tty_name = description->tty()->tty_name();
|
||||
auto& tty_name = description->tty()->tty_name();
|
||||
if (size < tty_name.length() + 1)
|
||||
return ERANGE;
|
||||
return copy_to_user(buffer, tty_name.characters(), tty_name.length() + 1);
|
||||
|
@ -32,7 +32,7 @@ KResultOr<FlatPtr> Process::sys$ptsname(int fd, Userspace<char*> buffer, size_t
|
|||
auto* master_pty = description->master_pty();
|
||||
if (!master_pty)
|
||||
return ENOTTY;
|
||||
auto pts_name = master_pty->pts_name();
|
||||
auto& pts_name = master_pty->pts_name();
|
||||
if (size < pts_name.length() + 1)
|
||||
return ERANGE;
|
||||
return copy_to_user(buffer, pts_name.characters(), pts_name.length() + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue