diff options
author | twosee <twose@qq.com> | 2021-05-28 22:57:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 10:57:59 -0400 |
commit | bcc4f8fdde45471f30e168fe27be347076ebdf2c (patch) | |
tree | ea8f96a82ff45403f6150d095931b568f47e7629 /docs/src | |
parent | 6085bcef8dea1eaa21a92e2b6e6f03a0476b6c54 (diff) | |
download | libuv-bcc4f8fdde45471f30e168fe27be347076ebdf2c.tar.gz libuv-bcc4f8fdde45471f30e168fe27be347076ebdf2c.zip |
stream: introduce uv_try_write2 function
`uv_try_write2(stream, bufs, nbufs, send_handle)` acts like
`uv_try_write()` and extended write function for sending handles over a
pipe like `uv_write2`. It always returns `UV_EAGAIN` instead of
`UV_ENOSYS` on Windows so we can easily write cross-platform code
without special treatment.
PR-URL: https://github.com/libuv/libuv/pull/3183
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/stream.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/src/stream.rst b/docs/src/stream.rst index 58ef7d98..ca7e83f7 100644 --- a/docs/src/stream.rst +++ b/docs/src/stream.rst @@ -207,6 +207,16 @@ API * < 0: negative error code (``UV_EAGAIN`` is returned if no data can be sent immediately). +.. c:function:: int uv_try_write2(uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t* send_handle) + + Same as :c:func:`uv_try_write` and extended write function for sending + handles over a pipe like c:func:`uv_write2`. + + Try to send a handle is not supported on Windows, + where it returns ``UV_EAGAIN``. + + .. versionadded:: 1.42.0 + .. c:function:: int uv_is_readable(const uv_stream_t* handle) Returns 1 if the stream is readable, 0 otherwise. |