summaryrefslogtreecommitdiff
path: root/Applications/SystemMonitor
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2020-01-11 19:00:15 +0300
committerAndreas Kling <awesomekling@gmail.com>2020-01-11 18:57:53 +0100
commit29db90088705944f10f38ad45fa8b80efd6ab0ad (patch)
treed28358495d8f97bbdedde84ad01e45b6c2b2b811 /Applications/SystemMonitor
parenta9e6f4a2cd7d8b728767e5488a3118f80409917e (diff)
downloadserenity-29db90088705944f10f38ad45fa8b80efd6ab0ad.zip
SystemMonitor: Display mount flags
Diffstat (limited to 'Applications/SystemMonitor')
-rw-r--r--Applications/SystemMonitor/main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp
index 7d4bda62ab..ee863d9793 100644
--- a/Applications/SystemMonitor/main.cpp
+++ b/Applications/SystemMonitor/main.cpp
@@ -266,6 +266,26 @@ RefPtr<GWidget> build_file_systems_tab()
df_fields.empend("Access", TextAlignment::CenterLeft, [](const JsonObject& object) {
return object.get("readonly").to_bool() ? "Read-only" : "Read/Write";
});
+ df_fields.empend("Mount flags", TextAlignment::CenterLeft, [](const JsonObject& object) {
+ int mount_flags = object.get("mount_flags").to_int();
+ StringBuilder builder;
+ bool first = true;
+ auto check = [&](int flag, const char* name) {
+ if (!(mount_flags & flag))
+ return;
+ if (!first)
+ builder.append(',');
+ builder.append(name);
+ first = false;
+ };
+ check(MS_NODEV, "nodev");
+ check(MS_NOEXEC, "noexec");
+ check(MS_NOSUID, "nosuid");
+ check(MS_BIND, "bind");
+ if (builder.string_view().is_empty())
+ return String("defaults");
+ return builder.to_string();
+ });
df_fields.empend("free_block_count", "Free blocks", TextAlignment::CenterRight);
df_fields.empend("total_block_count", "Total blocks", TextAlignment::CenterRight);
df_fields.empend("free_inode_count", "Free inodes", TextAlignment::CenterRight);