Latest revision |
Your text |
Line 4: |
Line 4: |
| ==Introduction== | | ==Introduction== |
| | | |
− | With [https://www.freebsd.org/cgi/man.cgi?kenv(1) kenv(1)] you can dump or modify the kernel environment. | + | With kenv you can dump or modify the kernel environment. |
− | The [https://www.freebsd.org/cgi/man.cgi?query=kenv&sektion=2&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports kenv(2)] system call manipulates kernel environment variables. It supports the well known userland actions of getting, setting and unsetting environment variables, as well as the ability to dump all of the entries in the kernel environment.
| + | |
| | | |
| ==Usage== | | ==Usage== |
Line 280: |
Line 279: |
| '''Attention''': The kernel environment variables are also tunable. Before you play with them, reed the man pages. It is possible to crash your system with a false value. | | '''Attention''': The kernel environment variables are also tunable. Before you play with them, reed the man pages. It is possible to crash your system with a false value. |
| | | |
− | ===The Action Argument===
| |
| | | |
− | The action argument can be one of the following:
| |
| | | |
− | {|class="wikitable" style="width:96.5%;background:#FFFFFF; border:2px solid #008000;text-align:left;padding: 10px"
| |
− | |-
| |
− | !scope="col" style="width: 100px;"|'''Action'''
| |
− | !scope="col" style="width: 500px;"|'''Desciption'''
| |
− | |-
| |
− | |KENV_GET || Get the value of the variable with the given name. The size
| |
− | of the value buffer is given by len, which should be at least
| |
− | KENV_MVALLEN + 1 bytes to avoid truncation and to ensure NUL
| |
− | termination.
| |
− | |-
| |
− | | KENV_SET|| Set or add a variable. The name and value are limited to
| |
− | KENV_MNAMELEN and KENV_MVALLEN characters, respectively (not
| |
− | including the NUL terminator.) The len argument indicates the
| |
− | length of the value and must include the NUL terminator.
| |
− | This option is only available to the superuser.
| |
− | |-
| |
− | |KENV_UNSET || Unset the variable with the given name. The value and len
| |
− | arguments are ignored. This option is only available to the
| |
− | superuser.
| |
− | |-
| |
− | |KENV_DUMP || Dump as much of the kernel environment as will fit in value,
| |
− | whose size is given in len. If value is NULL, kenv() will
| |
− | return the number of bytes required to copy out the entire
| |
− | environment. The name is ignored.
| |
| | | |
− | |}
| |
| | | |
| | | |