Returns the value associated with the named kernel environment variable. If the variable is not found, -1 is returned and the global variable errno is set to ENOENT. Only the number of bytes available in value are copied out.
Sets or adds a new kernel environment variable. This option is only available to the superuser.
Unsets the kernel environment variable name. If the variable does not exist, -1 is returned and the global variable errno is set to EINVAL. This option is only available to the superuser.
Dumps as much of the kernel environment as will fit in value. If value is NULL, kenv will return the number of bytes required to copy out the entire environment.
The name argument is the name of the environment variable to be affected. In the case of KENV_DUMP it is ignored.
The value argument contains either the value to set the environment variable name to in the case of KENV_SET, or it points to the location where kenv should copy return data to in the case of KENV_DUMP and KENV_GET. If value is NULL in the case of KENV_DUMP, kenv will return the number of bytes required to copy out the entire environment.
The len argument indicates how many bytes of storage value points to.