summaryrefslogtreecommitdiff
path: root/deps/uv/docs
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2017-05-30 13:19:11 -0400
committercjihrig <cjihrig@gmail.com>2017-06-07 09:30:01 -0400
commitedd541957f6bb6fa4ccb56bd1f878172f631ce36 (patch)
tree2a72ce78b05fc122c699d547152414f45d2cc16c /deps/uv/docs
parent12e39d6d943348a19da1bf84d4891aa28cd3ffb6 (diff)
downloadandroid-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.tar.gz
android-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.tar.bz2
android-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.zip
deps: upgrade libuv to 1.12.0
Fixes: https://github.com/nodejs/node/issues/12853 Fixes: https://github.com/nodejs/node/issues/854 PR-URL: https://github.com/nodejs/node/pull/13306 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/uv/docs')
-rw-r--r--deps/uv/docs/src/api.rst35
-rw-r--r--deps/uv/docs/src/conf.py18
-rw-r--r--deps/uv/docs/src/design.rst19
-rw-r--r--deps/uv/docs/src/fs.rst28
-rw-r--r--deps/uv/docs/src/fs_event.rst12
-rw-r--r--deps/uv/docs/src/fs_poll.rst9
-rw-r--r--deps/uv/docs/src/guide.rst22
-rw-r--r--deps/uv/docs/src/handle.rst4
-rw-r--r--deps/uv/docs/src/index.rst63
-rw-r--r--deps/uv/docs/src/loop.rst59
-rw-r--r--deps/uv/docs/src/misc.rst56
-rw-r--r--deps/uv/docs/src/signal.rst7
-rw-r--r--deps/uv/docs/src/threadpool.rst2
-rw-r--r--deps/uv/docs/src/upgrading.rst11
14 files changed, 258 insertions, 87 deletions
diff --git a/deps/uv/docs/src/api.rst b/deps/uv/docs/src/api.rst
new file mode 100644
index 0000000000..22f0640f54
--- /dev/null
+++ b/deps/uv/docs/src/api.rst
@@ -0,0 +1,35 @@
+.. _api:
+
+API documentation
+=================
+
+.. toctree::
+ :maxdepth: 1
+
+ errors
+ version
+ loop
+ handle
+ request
+ timer
+ prepare
+ check
+ idle
+ async
+ poll
+ signal
+ process
+ stream
+ tcp
+ pipe
+ tty
+ udp
+ fs_event
+ fs_poll
+ fs
+ threadpool
+ dns
+ dll
+ threading
+ misc
+
diff --git a/deps/uv/docs/src/conf.py b/deps/uv/docs/src/conf.py
index 3f8689d2e5..c9b4ea38c3 100644
--- a/deps/uv/docs/src/conf.py
+++ b/deps/uv/docs/src/conf.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# libuv API documentation documentation build configuration file, created by
+# libuv documentation documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 27 11:47:51 2014.
#
# This file is execfile()d with the current directory set to its
@@ -64,7 +64,7 @@ master_doc = 'index'
# General information about the project.
project = u'libuv API documentation'
-copyright = u'libuv contributors'
+copyright = u'2014-present, libuv contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -130,10 +130,10 @@ html_theme = 'nature'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
-html_title = 'libuv API documentation'
+html_title = 'libuv documentation'
# A shorter title for the navigation bar. Default is the same as html_title.
-html_short_title = 'libuv %s API documentation' % version
+html_short_title = 'libuv %s documentation' % version
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
@@ -216,7 +216,7 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- ('index', 'libuv.tex', u'libuv API documentation',
+ ('index', 'libuv.tex', u'libuv documentation',
u'libuv contributors', 'manual'),
]
@@ -246,7 +246,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'libuv', u'libuv API documentation',
+ ('index', 'libuv', u'libuv documentation',
[u'libuv contributors'], 1)
]
@@ -260,7 +260,7 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'libuv', u'libuv API documentation',
+ ('index', 'libuv', u'libuv documentation',
u'libuv contributors', 'libuv', 'Cross-platform asynchronous I/O',
'Miscellaneous'),
]
@@ -281,10 +281,10 @@ texinfo_documents = [
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
-epub_title = u'libuv API documentation'
+epub_title = u'libuv documentation'
epub_author = u'libuv contributors'
epub_publisher = u'libuv contributors'
-epub_copyright = u'2014, libuv contributors'
+epub_copyright = u'2014-present, libuv contributors'
# The basename for the epub file. It defaults to the project name.
epub_basename = u'libuv'
diff --git a/deps/uv/docs/src/design.rst b/deps/uv/docs/src/design.rst
index 34c3cff68e..487d08ba62 100644
--- a/deps/uv/docs/src/design.rst
+++ b/deps/uv/docs/src/design.rst
@@ -7,7 +7,7 @@ Design overview
libuv is cross-platform support library which was originally written for NodeJS. It's designed
around the event-driven asynchronous I/O model.
-The library provides much more than simply abstraction over different I/O polling mechanisms:
+The library provides much more than a simple abstraction over different I/O polling mechanisms:
'handles' and 'streams' provide a high level abstraction for sockets and other entities;
cross-platform file I/O and threading functionality is also provided, amongst other things.
@@ -25,9 +25,10 @@ Handles and requests
libuv provides users with 2 abstractions to work with, in combination with the event loop:
handles and requests.
-Handles represent long-lived objects capable of performing certain operations while active. Some
-examples: a prepare handle gets its callback called once every loop iteration when active, and
-a TCP server handle get its connection callback called every time there is a new connection.
+Handles represent long-lived objects capable of performing certain operations while active. Some examples:
+
+- A prepare handle gets its callback called once every loop iteration when active.
+- A TCP server handle that gets its connection callback called every time there is a new connection.
Requests represent (typically) short-lived operations. These operations can be performed over a
handle: write requests are used to write data on a handle; or standalone: getaddrinfo requests
@@ -85,11 +86,11 @@ stages of a loop iteration:
* If there are no active handles or requests, the timeout is 0.
* If there are any idle handles active, the timeout is 0.
* If there are any handles pending to be closed, the timeout is 0.
- * If none of the above cases was matched, the timeout of the closest timer is taken, or
+ * If none of the above cases matches, the timeout of the closest timer is taken, or
if there are no active timers, infinity.
-#. The loop blocks for I/O. At this point the loop will block for I/O for the timeout calculated
- on the previous step. All I/O related handles that were monitoring a given file descriptor
+#. The loop blocks for I/O. At this point the loop will block for I/O for the duration calculated
+ in the previous step. All I/O related handles that were monitoring a given file descriptor
for a read or write operation get their callbacks called at this point.
#. Check handle callbacks are called. Check handles get their callbacks called right after the
@@ -103,7 +104,7 @@ stages of a loop iteration:
so there might be timers which are due, those timers get their callbacks called.
#. Iteration ends. If the loop was run with ``UV_RUN_NOWAIT`` or ``UV_RUN_ONCE`` modes the
- iteration is ended and :c:func:`uv_run` will return. If the loop was run with ``UV_RUN_DEFAULT``
+ iteration ends and :c:func:`uv_run` will return. If the loop was run with ``UV_RUN_DEFAULT``
it will continue from the start if it's still *alive*, otherwise it will also end.
@@ -128,7 +129,7 @@ For a thorough explanation of the cross-platform file I/O landscape, checkout
libuv currently uses a global thread pool on which all loops can queue work on. 3 types of
operations are currently run on this pool:
- * Filesystem operations
+ * File system operations
* DNS functions (getaddrinfo and getnameinfo)
* User specified code via :c:func:`uv_queue_work`
diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst
index 192ecc7056..3f766e393f 100644
--- a/deps/uv/docs/src/fs.rst
+++ b/deps/uv/docs/src/fs.rst
@@ -1,15 +1,15 @@
.. _fs:
-Filesystem operations
-=====================
+File system operations
+======================
-libuv provides a wide variety of cross-platform sync and async filesystem
+libuv provides a wide variety of cross-platform sync and async file system
operations. All functions defined in this document take a callback, which is
allowed to be NULL. If the callback is NULL the request is completed synchronously,
otherwise it will be performed asynchronously.
-All file operations are run on the threadpool, see :ref:`threadpool` for information
+All file operations are run on the threadpool. See :ref:`threadpool` for information
on the threadpool size.
@@ -18,7 +18,7 @@ Data types
.. c:type:: uv_fs_t
- Filesystem request type.
+ File system request type.
.. c:type:: uv_timespec_t
@@ -58,7 +58,7 @@ Data types
.. c:type:: uv_fs_type
- Filesystem request type.
+ File system request type.
::
@@ -216,7 +216,7 @@ API
Unlike `scandir(3)`, this function does not return the "." and ".." entries.
.. note::
- On Linux, getting the type of an entry is only supported by some filesystems (btrfs, ext2,
+ On Linux, getting the type of an entry is only supported by some file systems (btrfs, ext2,
ext3 and ext4 at the time of this writing), check the :man:`getdents(2)` man page.
.. c:function:: int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
@@ -291,7 +291,7 @@ API
Equivalent to :man:`realpath(3)` on Unix. Windows uses `GetFinalPathNameByHandle <https://msdn.microsoft.com/en-us/library/windows/desktop/aa364962(v=vs.85).aspx>`_.
.. warning::
- This function has certain platform specific caveats that were discovered when used in Node.
+ This function has certain platform-specific caveats that were discovered when used in Node.
* macOS and other BSDs: this function will fail with UV_ELOOP if more than 32 symlinks are
found while resolving the given path. This limit is hardcoded and cannot be sidestepped.
@@ -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
diff --git a/deps/uv/docs/src/fs_event.rst b/deps/uv/docs/src/fs_event.rst
index c08ade2ef5..2af3e9802b 100644
--- a/deps/uv/docs/src/fs_event.rst
+++ b/deps/uv/docs/src/fs_event.rst
@@ -66,7 +66,7 @@ Data types
UV_FS_EVENT_WATCH_ENTRY = 1,
/*
* By default uv_fs_event will try to use a kernel interface such as inotify
- * or kqueue to detect events. This may not work on remote filesystems such
+ * or kqueue to detect events. This may not work on remote file systems such
* as NFS mounts. This flag makes fs_event fall back to calling stat() on a
* regular interval.
* This flag is currently not implemented yet on any backend.
@@ -74,7 +74,7 @@ Data types
UV_FS_EVENT_STAT = 2,
/*
* By default, event watcher, when watching directory, is not registering
- * (is ignoring) changes in it's subdirectories.
+ * (is ignoring) changes in its subdirectories.
* This flag will override this behaviour on platforms that support it.
*/
UV_FS_EVENT_RECURSIVE = 4
@@ -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/deps/uv/docs/src/fs_poll.rst b/deps/uv/docs/src/fs_poll.rst
index 4efb2440e0..2912bad934 100644
--- a/deps/uv/docs/src/fs_poll.rst
+++ b/deps/uv/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/deps/uv/docs/src/guide.rst b/deps/uv/docs/src/guide.rst
new file mode 100644
index 0000000000..126e08082c
--- /dev/null
+++ b/deps/uv/docs/src/guide.rst
@@ -0,0 +1,22 @@
+.. _guide:
+
+User guide
+==========
+
+.. warning::
+ The contents of this guide have been recently incorporated into the libuv documentation
+ and it hasn't gone through thorough review yet. If you spot a mistake please file an
+ issue, or better yet, open a pull request!
+
+.. toctree::
+ :maxdepth: 2
+
+ guide/introduction
+ guide/basics
+ guide/filesystem
+ guide/networking
+ guide/threads
+ guide/processes
+ guide/eventloops
+ guide/utilities
+ guide/about
diff --git a/deps/uv/docs/src/handle.rst b/deps/uv/docs/src/handle.rst
index 14aec51fff..a0f3d05fdb 100644
--- a/deps/uv/docs/src/handle.rst
+++ b/deps/uv/docs/src/handle.rst
@@ -86,9 +86,9 @@ Public members
Pointer to the :c:type:`uv_loop_t` where the handle is running on. Readonly.
-.. c:member:: uv_loop_t* uv_handle_t.type
+.. c:member:: uv_handle_type uv_handle_t.type
- Pointer to the :c:type:`uv_handle_type`. Readonly.
+ The :c:type:`uv_handle_type`, indicating the type of the underlying handle. Readonly.
.. c:member:: void* uv_handle_t.data
diff --git a/deps/uv/docs/src/index.rst b/deps/uv/docs/src/index.rst
index fa89c4bffe..5ec2beb511 100644
--- a/deps/uv/docs/src/index.rst
+++ b/deps/uv/docs/src/index.rst
@@ -1,6 +1,6 @@
-Welcome to the libuv API documentation
-======================================
+Welcome to the libuv documentation
+==================================
Overview
--------
@@ -37,59 +37,26 @@ Features
* Threading and synchronization primitives
-Downloads
----------
-
-libuv can be downloaded from `here <http://dist.libuv.org/dist/>`_.
-
+Documentation
+-------------
-Installation
-------------
+.. toctree::
+ :maxdepth: 1
-Installation instructions can be found on `the README <https://github.com/libuv/libuv/blob/master/README.md>`_.
+ design
+ api
+ guide
+ upgrading
-Upgrading
+Downloads
---------
-Migration guides for different libuv versions, starting with 1.0.
-
-.. toctree::
- :maxdepth: 1
-
- migration_010_100
+libuv can be downloaded from `here <http://dist.libuv.org/dist/>`_.
-Documentation
--------------
+Installation
+------------
-.. toctree::
- :maxdepth: 1
+Installation instructions can be found in `the README <https://github.com/libuv/libuv/blob/master/README.md>`_.
- design
- errors
- version
- loop
- handle
- request
- timer
- prepare
- check
- idle
- async
- poll
- signal
- process
- stream
- tcp
- pipe
- tty
- udp
- fs_event
- fs_poll
- fs
- threadpool
- dns
- dll
- threading
- misc
diff --git a/deps/uv/docs/src/loop.rst b/deps/uv/docs/src/loop.rst
index 1f504cb391..02543171de 100644
--- a/deps/uv/docs/src/loop.rst
+++ b/deps/uv/docs/src/loop.rst
@@ -38,9 +38,8 @@ Public members
.. c:member:: void* uv_loop_t.data
- Space for user-defined arbitrary data. libuv does not use this field. libuv does, however,
- initialize it to NULL in :c:func:`uv_loop_init`, and it poisons the value (on debug builds)
- on :c:func:`uv_loop_close`.
+ Space for user-defined arbitrary data. libuv does not use and does not
+ touch this field.
API
@@ -165,3 +164,57 @@ API
.. c:function:: void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg)
Walk the list of handles: `walk_cb` will be executed with the given `arg`.
+
+.. c:function:: int uv_loop_fork(uv_loop_t* loop)
+
+ .. versionadded:: 1.12.0
+
+ Reinitialize any kernel state necessary in the child process after
+ a :man:`fork(2)` system call.
+
+ Previously started watchers will continue to be started in the
+ child process.
+
+ It is necessary to explicitly call this function on every event
+ loop created in the parent process that you plan to continue to
+ use in the child, including the default loop (even if you don't
+ continue to use it in the parent). This function must be called
+ before calling :c:func:`uv_run` or any other API function using
+ the loop in the child. Failure to do so will result in undefined
+ behaviour, possibly including duplicate events delivered to both
+ parent and child or aborting the child process.
+
+ When possible, it is preferred to create a new loop in the child
+ process instead of reusing a loop created in the parent. New loops
+ created in the child process after the fork should not use this
+ function.
+
+ This function is not implemented on Windows, where it returns ``UV_ENOSYS``.
+
+ .. caution::
+
+ This function is experimental. It may contain bugs, and is subject to
+ change or removal. API and ABI stability is not guaranteed.
+
+ .. note::
+
+ On Mac OS X, if directory FS event handles were in use in the
+ parent process *for any event loop*, the child process will no
+ longer be able to use the most efficient FSEvent
+ implementation. Instead, uses of directory FS event handles in
+ the child will fall back to the same implementation used for
+ files and on other kqueue-based systems.
+
+ .. caution::
+
+ On AIX and SunOS, FS event handles that were already started in
+ the parent process at the time of forking will *not* deliver
+ events in the child process; they must be closed and restarted.
+ On all other platforms, they will continue to work normally
+ without any further intervention.
+
+ .. caution::
+
+ Any previous value returned from :c:func`uv_backend_fd` is now
+ invalid. That function must be called again to determine the
+ correct backend file descriptor.
diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst
index 7193469462..9d7c3617e8 100644
--- a/deps/uv/docs/src/misc.rst
+++ b/deps/uv/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.
@@ -386,3 +394,49 @@ 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
+
+.. c:function:: int uv_os_gethostname(char* buffer, size_t* size)
+
+ Returns the hostname as a null-terminated string in `buffer`, and sets
+ `size` to the string length of the hostname. When calling this function,
+ `size` must be set to the amount of storage available in `buffer`, including
+ the null terminator. If the hostname exceeds the storage available in
+ `buffer`, `UV_ENOBUFS` is returned, and `size` is set to the amount of
+ storage required to hold the value.
+
+ .. versionadded:: 1.12.0
diff --git a/deps/uv/docs/src/signal.rst b/deps/uv/docs/src/signal.rst
index dc1223b90a..5b3b352bdd 100644
--- a/deps/uv/docs/src/signal.rst
+++ b/deps/uv/docs/src/signal.rst
@@ -70,6 +70,13 @@ API
Start the handle with the given callback, watching for the given signal.
+.. c:function:: int uv_signal_start_oneshot(uv_signal_t* signal, uv_signal_cb cb, int signum)
+
+ .. versionadded:: 1.12.0
+
+ Same functionality as :c:func:`uv_signal_start` but the signal handler is reset the moment
+ the signal is received.
+
.. c:function:: int uv_signal_stop(uv_signal_t* signal)
Stop the handle, the callback will no longer be called.
diff --git a/deps/uv/docs/src/threadpool.rst b/deps/uv/docs/src/threadpool.rst
index 18949507e7..93bd236d35 100644
--- a/deps/uv/docs/src/threadpool.rst
+++ b/deps/uv/docs/src/threadpool.rst
@@ -5,7 +5,7 @@ Thread pool work scheduling
===========================
libuv provides a threadpool which can be used to run user code and get notified
-in the loop thread. This thread pool is internally used to run all filesystem
+in the loop thread. This thread pool is internally used to run all file system
operations, as well as getaddrinfo and getnameinfo requests.
Its default size is 4, but it can be changed at startup time by setting the
diff --git a/deps/uv/docs/src/upgrading.rst b/deps/uv/docs/src/upgrading.rst
new file mode 100644
index 0000000000..32840c2696
--- /dev/null
+++ b/deps/uv/docs/src/upgrading.rst
@@ -0,0 +1,11 @@
+.. _upgrading:
+
+Upgrading
+=========
+
+Migration guides for different libuv versions, starting with 1.0.
+
+.. toctree::
+ :maxdepth: 1
+
+ migration_010_100