mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-21 15:14:13 +00:00
Kernel: Add a way to print the pseudo name of attached TTY of a process
Contrary to the past, we don't attempt to assume the real name of a TTY device, but instead, we generate a pseudo name only when needed to do so which is still OK because we don't break abstraction layer rules and we still can provide userspace with the required information.
This commit is contained in:
@@ -495,6 +495,12 @@ private:
|
||||
TRY(process_object.add("uid", process.uid().value()));
|
||||
TRY(process_object.add("gid", process.gid().value()));
|
||||
TRY(process_object.add("ppid", process.ppid().value()));
|
||||
if (process.tty()) {
|
||||
auto tty_pseudo_name = TRY(process.tty()->pseudo_name());
|
||||
TRY(process_object.add("tty", tty_pseudo_name->view()));
|
||||
} else {
|
||||
TRY(process_object.add("tty", ""));
|
||||
}
|
||||
TRY(process_object.add("nfds", process.fds().with_shared([](auto& fds) { return fds.open_count(); })));
|
||||
TRY(process_object.add("name", process.name()));
|
||||
TRY(process_object.add("executable", process.executable() ? TRY(process.executable()->try_serialize_absolute_path())->view() : ""sv));
|
||||
|
||||
Reference in New Issue
Block a user