aboutsummaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorJuan Cruz Viotti <jviotti@openmailbox.org>2017-04-28 10:58:35 -0400
committercjihrig <cjihrig@gmail.com>2017-05-30 11:53:31 -0400
commite133923e935acc3a0b6371372c4ec56f797c8cae (patch)
treee6cac96965a698cdb56c80174af6f31064ac1005 /docs/src
parentce770a6c3bc88f11913b1a4067b9c026b63723e1 (diff)
downloadlibuv-e133923e935acc3a0b6371372c4ec56f797c8cae.tar.gz
libuv-e133923e935acc3a0b6371372c4ec56f797c8cae.zip
win: make uv__get_osfhandle() public
The uv__get_osfhandle() function is a private functio of the Windows subsystem, and its used to get a Windows HANDLE out of a file descriptor number. The motivation behind making this function public is to allow Node.js programs to pass file descriptors created using fs.open() to native Node.js C++ add-ons, and be able to successfully convert them to Windows HANDLEs. Refs: https://github.com/libuv/libuv/pull/1166 Refs: https://github.com/nodejs/node/issues/6369 Fixes: https://github.com/libuv/libuv/issues/1291 PR-URL: https://github.com/libuv/libuv/pull/1323 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/fs.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/src/fs.rst b/docs/src/fs.rst
index 234713ec..3f766e39 100644
--- a/docs/src/fs.rst
+++ b/docs/src/fs.rst
@@ -324,3 +324,15 @@ API
These functions are not implemented on Windows.
.. seealso:: The :c:type:`uv_req_t` API functions also apply.
+
+Helper functions
+----------------
+
+.. c:function:: uv_os_fd_t uv_get_osfhandle(int fd)
+
+ For a file descriptor in the C runtime, get the OS-dependent handle.
+ On UNIX, returns the ``fd`` intact. On Windows, this calls `_get_osfhandle <https://msdn.microsoft.com/en-us/library/ks2530z6.aspx>`_.
+ Note that the return value is still owned by the C runtime,
+ any attempts to close it or to use it after closing the fd may lead to malfunction.
+
+ .. versionadded:: 1.12.0