mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
sysctl: Use /sys/kernel/variables/ directory instead of /proc/sys
This commit is contained in:
parent
4556fdc891
commit
a0ed543993
Notes:
sideshowbarker
2024-07-17 05:06:49 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/a0ed543993 Pull-request: https://github.com/SerenityOS/serenity/pull/15593 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
2 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ sysctl - configure kernel parameters at runtime
|
|||
|
||||
sysctl is a utility for managing kernel configuration parameters at runtime.
|
||||
This requires root privileges, and can crash your system.
|
||||
Available parameters are listed under /proc/sys/.
|
||||
Available parameters are listed under /sys/kernel/variables/.
|
||||
|
||||
## Options
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ static bool s_set_variable = false;
|
|||
|
||||
static String get_variable(StringView name)
|
||||
{
|
||||
auto path = String::formatted("/proc/sys/{}", name);
|
||||
auto path = String::formatted("/sys/kernel/variables/{}", name);
|
||||
auto file = Core::File::construct(path);
|
||||
if (!file->open(Core::OpenMode::ReadOnly)) {
|
||||
warnln("Failed to open {}: {}", path, file->error_string());
|
||||
|
@ -42,7 +42,7 @@ static bool write_variable(StringView name, StringView value)
|
|||
auto old_value = get_variable(name);
|
||||
if (old_value.is_null())
|
||||
return false;
|
||||
auto path = String::formatted("/proc/sys/{}", name);
|
||||
auto path = String::formatted("/sys/kernel/variables/{}", name);
|
||||
auto file = Core::File::construct(path);
|
||||
if (!file->open(Core::OpenMode::WriteOnly)) {
|
||||
warnln("Failed to open {}: {}", path, file->error_string());
|
||||
|
@ -80,7 +80,7 @@ static int handle_variables(Vector<StringView> const& variables)
|
|||
|
||||
static int handle_show_all()
|
||||
{
|
||||
Core::DirIterator di("/proc/sys", Core::DirIterator::SkipDots);
|
||||
Core::DirIterator di("/sys/kernel/variables", Core::DirIterator::SkipDots);
|
||||
if (di.has_error()) {
|
||||
outln("DirIterator: {}", di.error_string());
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue