doc: note buffer lifetime requirements in uv_write

Fixes: https://github.com/libuv/libuv/issues/1072
PR-URL: https://github.com/libuv/libuv/pull/1074
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Vladimír Čunát 2016-09-29 11:15:04 +02:00 committed by cjihrig
parent 8221f9b305
commit 1bcdca290d

View File

@ -173,6 +173,10 @@ API
uv_write(&req1, stream, a, 2, cb);
uv_write(&req2, stream, b, 2, cb);
.. note::
The memory pointed to by the buffers must remain valid until the callback gets called.
This also holds for :c:func:`uv_write2`.
.. c:function:: int uv_write2(uv_write_t* req, uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t* send_handle, uv_write_cb cb)
Extended write function for sending handles over a pipe. The pipe must be