diff options
author | cjihrig <cjihrig@gmail.com> | 2017-02-28 00:21:26 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2017-03-08 20:39:33 -0500 |
commit | ee02f60c90bbf01e2107b3800b3dfbbe090484ab (patch) | |
tree | 79a0ef324a6ac5d375c95e13a0d3de7ed066e0fd /docs/src | |
parent | 2ba39be67e948f8b99af7cf408828f1507371fd5 (diff) | |
download | libuv-ee02f60c90bbf01e2107b3800b3dfbbe090484ab.tar.gz libuv-ee02f60c90bbf01e2107b3800b3dfbbe090484ab.zip |
unix,win: add uv_os_{get,set,unset}env()
These functions are used to create, retrieve, update, and delete
environment variables.
Fixes: https://github.com/libuv/libuv/issues/1198
PR-URL: https://github.com/libuv/libuv/pull/1234
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/misc.rst | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst index 71934694..5827787e 100644 --- a/docs/src/misc.rst +++ b/docs/src/misc.rst @@ -386,3 +386,38 @@ API stability guarantees. .. versionadded:: 1.8.0 + +.. c:function:: int uv_os_getenv(const char* name, char* buffer, size_t* size) + + Retrieves the environment variable specified by `name`, copies its value + into `buffer`, and sets `size` to the string length of the value. When + calling this function, `size` must be set to the amount of storage available + in `buffer`, including the null terminator. If the environment variable + exceeds the storage available in `buffer`, `UV_ENOBUFS` is returned, and + `size` is set to the amount of storage required to hold the value. If no + matching environment variable exists, `UV_ENOENT` is returned. + + .. warning:: + This function is not thread safe. + + .. versionadded:: 1.12.0 + +.. c:function:: int uv_os_setenv(const char* name, const char* value) + + Creates or updates the environment variable specified by `name` with + `value`. + + .. warning:: + This function is not thread safe. + + .. versionadded:: 1.12.0 + +.. c:function:: int uv_os_unsetenv(const char* name) + + Deletes the environment variable specified by `name`. If no such environment + variable exists, this function returns successfully. + + .. warning:: + This function is not thread safe. + + .. versionadded:: 1.12.0 |