#include <env/chEnv.h>int sysSetEnv(const char *envName, const char *envValue);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The sysSetEnv() system call inserts an environment variable and its value into the ChorusOS configuration environment. The envName pointer points to a null NULL-terminated string containing the environment variable to be set. The envValue pointer points to a NULL-terminated string containing the corresponding value of the environment variable.
Any existing value for envName in the configuration environment is removed and replaced by envValue.
On successful completion, K_OK is returned and the environment variable name and value are inserted into the configuration environment. Otherwise, a negative error code is returned.
envName was zero length, or an invalide name for a ChorusOS configuration environment variable.
For both user and supervisor access, there was insufficient space in the ChorusOS configuration environment to store envName and envValue. For user mode access, the string size of either envName or envValue exceeded the internal size limits imposed by the user system call implementation. The default values of these limits are 32 bytes for envName, and 256 bytes for envValue.
Some of the data provided are outside the current actor's address space.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|