summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-27 00:54:13 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-27 01:16:56 +0100
commit21ccbc2167dc426f825867ac87d79928c2acdd4f (patch)
tree2cc345fb98c413391e4b99fb6e05dec8972c2d2e /Kernel
parent87492e723b668e6ed772079201c300af089fb45d (diff)
downloadserenity-21ccbc2167dc426f825867ac87d79928c2acdd4f.zip
Kernel: Expose process executable paths in /proc/all
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FileSystem/ProcFS.cpp1
-rw-r--r--Kernel/Process.h6
2 files changed, 3 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