summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-03 08:42:40 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-03 08:42:40 +0200
commitf511421aaaffcd9dab236fa7bf9e15bb19c3a2a0 (patch)
treebfb4fdc4b306062400bd74d5878791cf24e03f72 /Applications
parent7f25959fa2083ecd2a335a9809de509180c797ca (diff)
downloadserenity-f511421aaaffcd9dab236fa7bf9e15bb19c3a2a0.zip
Kernel+ProcessManager: Add some more info to /proc/PID/fds
- "seekable": whether the fd is seekable or sequential. - "class": which kernel C++ class implements this File. - "offset": the current implicit POSIX API file offset.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/ProcessManager/ProcessFileDescriptorMapModel.cpp18
-rw-r--r--Applications/ProcessManager/ProcessFileDescriptorMapModel.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/Applications/ProcessManager/ProcessFileDescriptorMapModel.cpp b/Applications/ProcessManager/ProcessFileDescriptorMapModel.cpp
index 512d1474dd..e3233ba0b1 100644
--- a/Applications/ProcessManager/ProcessFileDescriptorMapModel.cpp
+++ b/Applications/ProcessManager/ProcessFileDescriptorMapModel.cpp
@@ -29,6 +29,12 @@ String ProcessFileDescriptorMapModel::column_name(int column) const
switch (column) {
case Column::FileDescriptor:
return "FD";
+ case Column::ClassName:
+ return "Class";
+ case Column::Offset:
+ return "Offset";
+ case Column::Access:
+ return "Access";
case Column::Path:
return "Path";
default:
@@ -41,6 +47,12 @@ GModel::ColumnMetadata ProcessFileDescriptorMapModel::column_metadata(int column
switch (column) {
case Column::FileDescriptor:
return { 32, TextAlignment::CenterRight };
+ case Column::ClassName:
+ return { 80, TextAlignment::CenterLeft };
+ case Column::Offset:
+ return { 40, TextAlignment::CenterRight };
+ case Column::Access:
+ return { 60, TextAlignment::CenterLeft };
case Column::Path:
return { 300, TextAlignment::CenterLeft };
default:
@@ -56,6 +68,12 @@ GVariant ProcessFileDescriptorMapModel::data(const GModelIndex& index, Role role
switch (index.column()) {
case Column::FileDescriptor:
return fd_object.get("fd").to_int();
+ case Column::ClassName:
+ return fd_object.get("class").to_string();
+ case Column::Offset:
+ return fd_object.get("offset").to_int();
+ case Column::Access:
+ return fd_object.get("seekable").to_bool() ? "Seekable" : "Sequential";
case Column::Path:
return fd_object.get("absolute_path").to_string();
default:
diff --git a/Applications/ProcessManager/ProcessFileDescriptorMapModel.h b/Applications/ProcessManager/ProcessFileDescriptorMapModel.h
index b9386df903..88c08a3cf7 100644
--- a/Applications/ProcessManager/ProcessFileDescriptorMapModel.h
+++ b/Applications/ProcessManager/ProcessFileDescriptorMapModel.h
@@ -8,6 +8,9 @@ public:
enum Column {
FileDescriptor,
Path,
+ Offset,
+ Access,
+ ClassName,
__Count
};