[kernel,cmds] Add sysctl system call and option get/set command #1897
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds new lightweight
sysctl(int op, char *name, int *value)system call andsysctl [-a] [option_name[=value]]utility.syscall -alists all available options and their values.These enhancements are for some upcoming functionality that allows for turning on and off various options at runtime, such as malloc debugging information, TCP/IP options, etc. The combination allows for both querying a human-readable option "name" value and and its associated (currently numeric only) value. The
sysctlcommand is also scriptable, for easy test integration. The combination allows for application programs to query and set information, which previously required special techniques.The planned usage might be something like
sysctl malloc.debug=1to turn on level 1mallocdebug output, for instance, or communicating with a runningktcpby usingsysctl net.debug=3, etc. The option names are just string values defined in the kernel and associated with anintvariable.The current list of options are:
Ideas for future options are welcomed.