mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:48:14 +00:00
ProcFS: Expose process pledge promises in /proc/all
This commit is contained in:
parent
2f880a047f
commit
b36608f47c
1 changed files with 11 additions and 0 deletions
|
@ -758,6 +758,17 @@ Optional<KBuffer> procfs$all(InodeIdentifier)
|
||||||
// Keep this in sync with CProcessStatistics.
|
// Keep this in sync with CProcessStatistics.
|
||||||
auto build_process = [&](const Process& process) {
|
auto build_process = [&](const Process& process) {
|
||||||
auto process_object = array.add_object();
|
auto process_object = array.add_object();
|
||||||
|
|
||||||
|
StringBuilder pledge_builder;
|
||||||
|
#define __ENUMERATE_PLEDGE_PROMISE(promise) \
|
||||||
|
if (process.has_promised(Pledge::promise)) { \
|
||||||
|
pledge_builder.append(#promise " "); \
|
||||||
|
}
|
||||||
|
ENUMERATE_PLEDGE_PROMISES
|
||||||
|
#undef __ENUMERATE_PLEDGE_PROMISE
|
||||||
|
|
||||||
|
process_object.add("pledge", pledge_builder.to_string());
|
||||||
|
|
||||||
process_object.add("pid", process.pid());
|
process_object.add("pid", process.pid());
|
||||||
process_object.add("pgid", process.tty() ? process.tty()->pgid() : 0);
|
process_object.add("pgid", process.tty() ? process.tty()->pgid() : 0);
|
||||||
process_object.add("pgp", process.pgid());
|
process_object.add("pgp", process.pgid());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue