diff options
author | cjihrig <cjihrig@gmail.com> | 2017-02-28 12:32:15 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2017-03-08 20:55:40 -0500 |
commit | c4bd9f48e0b3c1b58606a6c53613165fcd5a4f74 (patch) | |
tree | 8f3b00333f3c9aaf44d62b15c64e9fd3949993d0 /docs/src | |
parent | 53995a3825d23eacd01e2bcfa35642c4a188d32b (diff) | |
download | libuv-c4bd9f48e0b3c1b58606a6c53613165fcd5a4f74.tar.gz libuv-c4bd9f48e0b3c1b58606a6c53613165fcd5a4f74.zip |
docs: improve UV_ENOBUFS scenario documentation
This commit adds additional documentation to the UV_ENOBUFS
scenario for several methods.
Fixes: https://github.com/libuv/libuv/issues/1179
PR-URL: https://github.com/libuv/libuv/pull/1235
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/fs_event.rst | 8 | ||||
-rw-r--r-- | docs/src/fs_poll.rst | 9 | ||||
-rw-r--r-- | docs/src/misc.rst | 10 |
3 files changed, 22 insertions, 5 deletions
diff --git a/docs/src/fs_event.rst b/docs/src/fs_event.rst index c08ade2e..fb855b0b 100644 --- a/docs/src/fs_event.rst +++ b/docs/src/fs_event.rst @@ -113,10 +113,14 @@ API Get the path being monitored by the handle. The buffer must be preallocated by the user. Returns 0 on success or an error code < 0 in case of failure. On success, `buffer` will contain the path and `size` its length. If the buffer - is not big enough UV_ENOBUFS will be returned and len will be set to the - required size. + is not big enough `UV_ENOBUFS` will be returned and `size` will be set to + the required size, including the null terminator. .. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte, and the buffer is not null terminated. + .. versionchanged:: 1.9.0 the returned length includes the terminating null + byte on `UV_ENOBUFS`, and the buffer is null terminated + on success. + .. seealso:: The :c:type:`uv_handle_t` API functions also apply. diff --git a/docs/src/fs_poll.rst b/docs/src/fs_poll.rst index 4efb2440..2912bad9 100644 --- a/docs/src/fs_poll.rst +++ b/docs/src/fs_poll.rst @@ -63,10 +63,15 @@ API Get the path being monitored by the handle. The buffer must be preallocated by the user. Returns 0 on success or an error code < 0 in case of failure. On success, `buffer` will contain the path and `size` its length. If the buffer - is not big enough UV_ENOBUFS will be returned and len will be set to the - required size. + is not big enough `UV_ENOBUFS` will be returned and `size` will be set to + the required size. .. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte, and the buffer is not null terminated. + .. versionchanged:: 1.9.0 the returned length includes the terminating null + byte on `UV_ENOBUFS`, and the buffer is null terminated + on success. + + .. seealso:: The :c:type:`uv_handle_t` API functions also apply. diff --git a/docs/src/misc.rst b/docs/src/misc.rst index 5827787e..a92b74f4 100644 --- a/docs/src/misc.rst +++ b/docs/src/misc.rst @@ -270,12 +270,20 @@ API .. c:function:: int uv_cwd(char* buffer, size_t* size) - Gets the current working directory. + Gets the current working directory, and stores it in `buffer`. If the + current working directory is too large to fit in `buffer`, this function + returns `UV_ENOBUFS`, and sets `size` to the required length, including the + null terminator. .. versionchanged:: 1.1.0 On Unix the path no longer ends in a slash. + .. versionchanged:: 1.9.0 the returned length includes the terminating null + byte on `UV_ENOBUFS`, and the buffer is null terminated + on success. + + .. c:function:: int uv_chdir(const char* dir) Changes the current working directory. |