aboutsummaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2016-01-04 16:52:44 -0500
committerSaúl Ibarra Corretgé <saghul@gmail.com>2016-01-21 09:11:56 +0100
commitc0fa2e7518a3a0e364c56f8223bdd0f549ddac66 (patch)
treeeafd65b67a5a62d0c9ef48f5047b4f95efab467b /docs/src
parentd41749d546e70c5456c13c8741c7784c2c4b2048 (diff)
downloadlibuv-c0fa2e7518a3a0e364c56f8223bdd0f549ddac66.tar.gz
libuv-c0fa2e7518a3a0e364c56f8223bdd0f549ddac66.zip
unix,win: add uv_os_tmpdir()
PR-URL: https://github.com/libuv/libuv/pull/672 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/misc.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst
index 2ce0887d..bf234dae 100644
--- a/docs/src/misc.rst
+++ b/docs/src/misc.rst
@@ -273,6 +273,22 @@ API
.. versionadded:: 1.6.0
+.. c:function:: int uv_os_tmpdir(char* buffer, size_t* size)
+
+ Gets the temp directory. On Windows, `uv_os_tmpdir()` uses `GetTempPathW()`.
+ On all other operating systems, `uv_os_tmpdir()` uses the first environment
+ variable found in the ordered list `TMPDIR`, `TMP`, `TEMP`, and `TEMPDIR`.
+ If none of these are found, the path `"/tmp"` is used, or, on Android,
+ `"/data/local/tmp"` is used. The temp directory is stored in `buffer`. When
+ `uv_os_tmpdir()` is called, `size` indicates the maximum size of `buffer`.
+ On success or `UV_ENOBUFS` failure, `size` is set to the string length of
+ `buffer` (which does not include the terminating null).
+
+ .. warning::
+ `uv_os_tmpdir()` is not thread safe.
+
+ .. versionadded:: 1.9.0
+
.. uint64_t uv_get_free_memory(void)
.. c:function:: uint64_t uv_get_total_memory(void)