diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index 93ea6a006c..4300161046 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -93,6 +93,8 @@ String ProcessModel::column_name(int column) const return "File In"; case Column::FileWriteBytes: return "File Out"; + case Column::Pledge: + return "Pledge"; default: ASSERT_NOT_REACHED(); } @@ -151,6 +153,8 @@ GModel::ColumnMetadata ProcessModel::column_metadata(int column) const return { 60, TextAlignment::CenterRight }; case Column::IPv4SocketWriteBytes: return { 60, TextAlignment::CenterRight }; + case Column::Pledge: + return { 60, TextAlignment::CenterLeft }; default: ASSERT_NOT_REACHED(); } @@ -220,6 +224,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const return thread.current_state.file_read_bytes; case Column::FileWriteBytes: return thread.current_state.file_write_bytes; + case Column::Pledge: + return thread.current_state.pledge; } ASSERT_NOT_REACHED(); return {}; @@ -285,6 +291,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const return thread.current_state.file_read_bytes; case Column::FileWriteBytes: return thread.current_state.file_write_bytes; + case Column::Pledge: + return thread.current_state.pledge; } } @@ -306,6 +314,7 @@ void ProcessModel::update() ThreadState state; state.pid = it.value.pid; state.user = it.value.username; + state.pledge = it.value.pledge; state.syscall_count = thread.syscall_count; state.inode_faults = thread.inode_faults; state.zero_faults = thread.zero_faults; diff --git a/Applications/SystemMonitor/ProcessModel.h b/Applications/SystemMonitor/ProcessModel.h index 2572444ccc..abff85011a 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -35,6 +35,7 @@ public: CleanInode, PurgeableVolatile, PurgeableNonvolatile, + Pledge, Syscalls, InodeFaults, ZeroFaults, @@ -72,6 +73,7 @@ private: String name; String state; String user; + String pledge; u32 priority; u32 effective_priority; size_t amount_virtual; diff --git a/Libraries/LibCore/CProcessStatisticsReader.cpp b/Libraries/LibCore/CProcessStatisticsReader.cpp index 423df32ad8..5807a5d11c 100644 --- a/Libraries/LibCore/CProcessStatisticsReader.cpp +++ b/Libraries/LibCore/CProcessStatisticsReader.cpp @@ -35,6 +35,7 @@ HashMap CProcessStatisticsReader::get_all() process.nfds = process_object.get("nfds").to_u32(); process.name = process_object.get("name").to_string(); process.tty = process_object.get("tty").to_string(); + process.pledge = process_object.get("pledge").to_string(); process.amount_virtual = process_object.get("amount_virtual").to_u32(); process.amount_resident = process_object.get("amount_resident").to_u32(); process.amount_shared = process_object.get("amount_shared").to_u32(); diff --git a/Libraries/LibCore/CProcessStatisticsReader.h b/Libraries/LibCore/CProcessStatisticsReader.h index fe49eccb8a..0bd424aae5 100644 --- a/Libraries/LibCore/CProcessStatisticsReader.h +++ b/Libraries/LibCore/CProcessStatisticsReader.h @@ -37,6 +37,7 @@ struct CProcessStatistics { unsigned nfds; String name; String tty; + String pledge; size_t amount_virtual; size_t amount_resident; size_t amount_shared;