Base: Add sysctl man page
This commit is contained in:
parent
fb68aa1480
commit
69b98f7d32
Notes:
sideshowbarker
2024-07-18 21:37:34 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/69b98f7d326 Pull-request: https://github.com/SerenityOS/serenity/pull/5689 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/emanuele6
2 changed files with 51 additions and 1 deletions
50
Base/usr/share/man/man8/sysctl.md
Normal file
50
Base/usr/share/man/man8/sysctl.md
Normal file
|
@ -0,0 +1,50 @@
|
|||
## Name
|
||||
|
||||
sysctl - configure kernel parameters at runtime
|
||||
|
||||
## Synopsis
|
||||
|
||||
```**sh
|
||||
# sysctl [-a] [variable[=value]]
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
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/.
|
||||
|
||||
## Options
|
||||
|
||||
* `-a`: Display all kernel parameters and associated values
|
||||
|
||||
## Arguments
|
||||
|
||||
* `variable`: Retrieve the specified parameter
|
||||
* `variable=value`: Set the specified parameter to the specified value
|
||||
|
||||
## Files
|
||||
|
||||
* `/proc/sys` - source of kernel parameters
|
||||
|
||||
## Examples
|
||||
|
||||
View all parameters:
|
||||
|
||||
```sh
|
||||
# sysctl -a
|
||||
```
|
||||
|
||||
View `ubsan_is_deadly` parameter:
|
||||
|
||||
```sh
|
||||
# sysctl ubsan_is_deadly
|
||||
ubsan_is_deadly = 1
|
||||
```
|
||||
|
||||
Set `ubsan_is_deadly` parameter to zero (disabled):
|
||||
|
||||
```sh
|
||||
# sysctl ubsan_is_deadly=0
|
||||
ubsan_is_deadly = 1 -> 0
|
||||
```
|
|
@ -117,7 +117,7 @@ int main(int argc, char** argv)
|
|||
args_parser.set_general_help(
|
||||
"Show or modify system-internal values. This requires root, and can crash your system.");
|
||||
args_parser.add_option(show_all, "Show all variables", nullptr, 'a');
|
||||
args_parser.add_positional_argument(var, "Command (var[=value])", "command", Core::ArgsParser::Required::No);
|
||||
args_parser.add_positional_argument(var, "variable[=value]", "variable", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
if (var == nullptr) {
|
||||
|
|
Loading…
Add table
Reference in a new issue