diff options
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 1 | ||||
-rw-r--r-- | Kernel/Process.h | 6 | ||||
-rw-r--r-- | Libraries/LibCore/ProcessStatisticsReader.cpp | 1 | ||||
-rw-r--r-- | Libraries/LibCore/ProcessStatisticsReader.h | 1 |
4 files changed, 5 insertions, 4 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 3d281305c2..a81cbf575d 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -872,6 +872,7 @@ static OwnPtr<KBuffer> procfs$all(InodeIdentifier) process_object.add("ppid", process.ppid().value()); process_object.add("nfds", process.number_of_open_file_descriptors()); process_object.add("name", process.name()); + process_object.add("executable", process.executable() ? process.executable()->absolute_path() : ""); process_object.add("tty", process.tty() ? process.tty()->tty_name() : "notty"); process_object.add("amount_virtual", process.amount_virtual()); process_object.add("amount_resident", process.amount_resident()); diff --git a/Kernel/Process.h b/Kernel/Process.h index aebd5dc3f8..879b8db96c 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -391,10 +391,8 @@ public: u32 m_ticks_in_kernel_for_dead_children { 0 }; Custody& current_directory(); - Custody* executable() - { - return m_executable.ptr(); - } + Custody* executable() { return m_executable.ptr(); } + const Custody* executable() const { return m_executable.ptr(); } int number_of_open_file_descriptors() const; int max_open_file_descriptors() const diff --git a/Libraries/LibCore/ProcessStatisticsReader.cpp b/Libraries/LibCore/ProcessStatisticsReader.cpp index 5a0ff949c6..948e25aa3c 100644 --- a/Libraries/LibCore/ProcessStatisticsReader.cpp +++ b/Libraries/LibCore/ProcessStatisticsReader.cpp @@ -64,6 +64,7 @@ HashMap<pid_t, Core::ProcessStatistics> ProcessStatisticsReader::get_all() process.ppid = process_object.get("ppid").to_u32(); process.nfds = process_object.get("nfds").to_u32(); process.name = process_object.get("name").to_string(); + process.executable = process_object.get("executable").to_string(); process.tty = process_object.get("tty").to_string(); process.pledge = process_object.get("pledge").to_string(); process.veil = process_object.get("veil").to_string(); diff --git a/Libraries/LibCore/ProcessStatisticsReader.h b/Libraries/LibCore/ProcessStatisticsReader.h index 9c3bd93a80..0e4765d906 100644 --- a/Libraries/LibCore/ProcessStatisticsReader.h +++ b/Libraries/LibCore/ProcessStatisticsReader.h @@ -66,6 +66,7 @@ struct ProcessStatistics { pid_t ppid; unsigned nfds; String name; + String executable; String tty; String pledge; String veil; |