diff --git a/Userland/Utilities/aplay.cpp b/Userland/Utilities/aplay.cpp index ed57cfc685..1a9a1d1885 100644 --- a/Userland/Utilities/aplay.cpp +++ b/Userland/Utilities/aplay.cpp @@ -35,7 +35,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(show_sample_progress, "Show playback progress in samples", "sample-progress", 's'); args_parser.parse(arguments); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/audio", "rw")); TRY(Core::System::unveil(Core::File::absolute_path(path), "r"sv)); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/arp.cpp b/Userland/Utilities/arp.cpp index 5b1930224c..40ed9ff463 100644 --- a/Userland/Utilities/arp.cpp +++ b/Userland/Utilities/arp.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio rpath tty inet unix")); - TRY(Core::System::unveil("/proc/net/arp", "r")); + TRY(Core::System::unveil("/sys/kernel/net/arp", "r")); TRY(Core::System::unveil("/tmp/portal/lookup", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); @@ -89,7 +89,7 @@ ErrorOr serenity_main(Main::Arguments arguments) outln(); if (!flag_set && !flag_delete) { - auto file = Core::File::construct("/proc/net/arp"); + auto file = Core::File::construct("/sys/kernel/net/arp"); if (!file->open(Core::OpenMode::ReadOnly)) { warnln("Failed to open {}: {}", file->name(), file->error_string()); return 1; diff --git a/Userland/Utilities/df.cpp b/Userland/Utilities/df.cpp index 95bead800e..679c6ed012 100644 --- a/Userland/Utilities/df.cpp +++ b/Userland/Utilities/df.cpp @@ -33,7 +33,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(flag_human_readable, "Print human-readable sizes", "human-readable", 'h'); args_parser.parse(arguments); - auto file = TRY(Core::File::open("/proc/df", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/df", Core::OpenMode::ReadOnly)); if (flag_human_readable) { outln("Filesystem Size Used Available Mount point"); diff --git a/Userland/Utilities/dmesg.cpp b/Userland/Utilities/dmesg.cpp index 15d33eebd5..a2d53367fd 100644 --- a/Userland/Utilities/dmesg.cpp +++ b/Userland/Utilities/dmesg.cpp @@ -11,10 +11,10 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); - TRY(Core::System::unveil("/proc/dmesg", "r")); + TRY(Core::System::unveil("/sys/kernel/dmesg", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto file = TRY(Core::File::open("/proc/dmesg", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/dmesg", Core::OpenMode::ReadOnly)); auto buffer = file->read_all(); out("{}", StringView { buffer }); return 0; diff --git a/Userland/Utilities/ifconfig.cpp b/Userland/Utilities/ifconfig.cpp index e137a08eda..e626715a94 100644 --- a/Userland/Utilities/ifconfig.cpp +++ b/Userland/Utilities/ifconfig.cpp @@ -37,7 +37,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.parse(arguments); if (value_ipv4.is_empty() && value_adapter.is_empty() && value_mask.is_empty()) { - auto file = TRY(Core::File::open("/proc/net/adapters", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/net/adapters", Core::OpenMode::ReadOnly)); auto json = TRY(JsonValue::from_string(file->read_all())); json.as_array().for_each([](auto& value) { diff --git a/Userland/Utilities/logout.cpp b/Userland/Utilities/logout.cpp index 32f5679dfd..59bd1e3c57 100644 --- a/Userland/Utilities/logout.cpp +++ b/Userland/Utilities/logout.cpp @@ -12,7 +12,7 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio proc rpath")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/lscpu.cpp b/Userland/Utilities/lscpu.cpp index fc78e579b1..afcbd26d9b 100644 --- a/Userland/Utilities/lscpu.cpp +++ b/Userland/Utilities/lscpu.cpp @@ -56,10 +56,10 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); - TRY(Core::System::unveil("/proc/cpuinfo", "r")); + TRY(Core::System::unveil("/sys/kernel/cpuinfo", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto file = TRY(Core::File::open("/proc/cpuinfo", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/cpuinfo", Core::OpenMode::ReadOnly)); auto json = TRY(JsonValue::from_string(file->read_all())); auto& array = json.as_array(); diff --git a/Userland/Utilities/lsirq.cpp b/Userland/Utilities/lsirq.cpp index 57fd248122..ce7952a436 100644 --- a/Userland/Utilities/lsirq.cpp +++ b/Userland/Utilities/lsirq.cpp @@ -13,10 +13,10 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); - TRY(Core::System::unveil("/proc/interrupts", "r")); + TRY(Core::System::unveil("/sys/kernel/interrupts", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto proc_interrupts = TRY(Core::File::open("/proc/interrupts", Core::OpenMode::ReadOnly)); + auto proc_interrupts = TRY(Core::File::open("/sys/kernel/interrupts", Core::OpenMode::ReadOnly)); TRY(Core::System::pledge("stdio")); diff --git a/Userland/Utilities/lsof.cpp b/Userland/Utilities/lsof.cpp index 36f605aa40..9c280ec33f 100644 --- a/Userland/Utilities/lsof.cpp +++ b/Userland/Utilities/lsof.cpp @@ -105,6 +105,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/proc", "r")); // needed by ProcessStatisticsReader::get_all() + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp index c2a192b57c..4269a88929 100644 --- a/Userland/Utilities/mount.cpp +++ b/Userland/Utilities/mount.cpp @@ -153,7 +153,7 @@ static ErrorOr mount_all() static ErrorOr print_mounts() { // Output info about currently mounted filesystems. - auto df = TRY(Core::File::open("/proc/df", Core::OpenMode::ReadOnly)); + auto df = TRY(Core::File::open("/sys/kernel/df", Core::OpenMode::ReadOnly)); auto content = df->read_all(); auto json = TRY(JsonValue::from_string(content)); diff --git a/Userland/Utilities/netstat.cpp b/Userland/Utilities/netstat.cpp index c174cad2f2..d86ddd9a9f 100644 --- a/Userland/Utilities/netstat.cpp +++ b/Userland/Utilities/netstat.cpp @@ -44,8 +44,8 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(flag_wide, "Do not truncate IP addresses by printing out the whole symbolic host", "wide", 'W'); args_parser.parse(arguments); - TRY(Core::System::unveil("/proc/net", "r")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/net", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil("/etc/services", "r")); TRY(Core::System::unveil("/tmp/portal/lookup", "rw")); @@ -154,7 +154,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } if (!has_protocol_flag || flag_tcp) { - auto file = Core::File::construct("/proc/net/tcp"); + auto file = Core::File::construct("/sys/kernel/net/tcp"); if (!file->open(Core::OpenMode::ReadOnly)) { warnln("Error: {}", file->error_string()); return 1; @@ -251,7 +251,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } if (!has_protocol_flag || flag_udp) { - auto file = TRY(Core::File::open("/proc/net/udp", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/net/udp", Core::OpenMode::ReadOnly)); auto file_contents = file->read_all(); auto json = TRY(JsonValue::from_string(file_contents)); diff --git a/Userland/Utilities/nproc.cpp b/Userland/Utilities/nproc.cpp index e1f9f9a5fe..fe00b806a3 100644 --- a/Userland/Utilities/nproc.cpp +++ b/Userland/Utilities/nproc.cpp @@ -12,7 +12,7 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); - auto file = TRY(Core::File::open("/proc/cpuinfo", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/cpuinfo", Core::OpenMode::ReadOnly)); auto buffer = file->read_all(); auto json = TRY(JsonValue::from_string({ buffer })); diff --git a/Userland/Utilities/pgrep.cpp b/Userland/Utilities/pgrep.cpp index a35e278424..d7929c91e5 100644 --- a/Userland/Utilities/pgrep.cpp +++ b/Userland/Utilities/pgrep.cpp @@ -15,7 +15,7 @@ ErrorOr serenity_main(Main::Arguments args) { TRY(Core::System::pledge("stdio rpath")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/pidof.cpp b/Userland/Utilities/pidof.cpp index fc4d38a649..1e6d16e28b 100644 --- a/Userland/Utilities/pidof.cpp +++ b/Userland/Utilities/pidof.cpp @@ -43,7 +43,7 @@ static ErrorOr pid_of(String const& process_name, bool single_shot, bool om ErrorOr serenity_main(Main::Arguments args) { TRY(Core::System::pledge("stdio rpath")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/pkill.cpp b/Userland/Utilities/pkill.cpp index 8d993db903..057a8fd73f 100644 --- a/Userland/Utilities/pkill.cpp +++ b/Userland/Utilities/pkill.cpp @@ -18,7 +18,7 @@ ErrorOr serenity_main(Main::Arguments args) { TRY(Core::System::pledge("stdio proc rpath")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/profile.cpp b/Userland/Utilities/profile.cpp index 5b285249e4..d39f9a9a84 100644 --- a/Userland/Utilities/profile.cpp +++ b/Userland/Utilities/profile.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments arguments) bool seen_event_type_arg = false; args_parser.add_option(pid_argument, "Target PID", nullptr, 'p', "PID"); - args_parser.add_option(all_processes, "Profile all processes (super-user only), result at /proc/profile", nullptr, 'a'); + args_parser.add_option(all_processes, "Profile all processes (super-user only), result at /sys/kernel/profile", nullptr, 'a'); args_parser.add_option(enable, "Enable", nullptr, 'e'); args_parser.add_option(disable, "Disable", nullptr, 'd'); args_parser.add_option(free, "Free the profiling buffer for the associated process(es).", nullptr, 'f'); diff --git a/Userland/Utilities/ps.cpp b/Userland/Utilities/ps.cpp index a7bea5933d..b080a72b12 100644 --- a/Userland/Utilities/ps.cpp +++ b/Userland/Utilities/ps.cpp @@ -41,7 +41,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto this_pseudo_tty_name = TRY(determine_tty_pseudo_name()); TRY(Core::System::pledge("stdio rpath")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/route.cpp b/Userland/Utilities/route.cpp index efe0aedf3d..58dfe9ea9d 100644 --- a/Userland/Utilities/route.cpp +++ b/Userland/Utilities/route.cpp @@ -25,7 +25,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio rpath inet")); - TRY(Core::System::unveil("/proc/net", "r")); + TRY(Core::System::unveil("/sys/kernel/net", "r")); TRY(Core::System::unveil(nullptr, nullptr)); StringView modify_action; @@ -89,7 +89,7 @@ ErrorOr serenity_main(Main::Arguments arguments) }; if (modify_action.is_empty()) { - auto file = TRY(Core::File::open("/proc/net/route", Core::OpenMode::ReadOnly)); + auto file = TRY(Core::File::open("/sys/kernel/net/route", Core::OpenMode::ReadOnly)); auto file_contents = file->read_all(); auto json = TRY(JsonValue::from_string(file_contents)); diff --git a/Userland/Utilities/top.cpp b/Userland/Utilities/top.cpp index 2f4d53840d..5c1fc87b68 100644 --- a/Userland/Utilities/top.cpp +++ b/Userland/Utilities/top.cpp @@ -201,7 +201,7 @@ static void enable_nonblocking_stdin() ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio rpath tty sigaction")); - TRY(Core::System::unveil("/proc/all", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); unveil(nullptr, nullptr); diff --git a/Userland/Utilities/uptime.cpp b/Userland/Utilities/uptime.cpp index ce698461ac..94693287d9 100644 --- a/Userland/Utilities/uptime.cpp +++ b/Userland/Utilities/uptime.cpp @@ -14,9 +14,9 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); - FILE* fp = fopen("/proc/uptime", "r"); + FILE* fp = fopen("/sys/kernel/uptime", "r"); if (!fp) { - perror("fopen(/proc/uptime)"); + perror("fopen(/sys/kernel/uptime)"); return 1; } diff --git a/Userland/Utilities/w.cpp b/Userland/Utilities/w.cpp index fce935b80c..6a30cd46d3 100644 --- a/Userland/Utilities/w.cpp +++ b/Userland/Utilities/w.cpp @@ -22,7 +22,7 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil("/var/run/utmp", "r")); - TRY(Core::System::unveil("/proc", "r")); + TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil(nullptr, nullptr)); auto file = TRY(Core::File::open("/var/run/utmp", Core::OpenMode::ReadOnly));