Source code examples in the User guide were not appearing in the built
documentation because the relative paths were incorrect.
PR-URL: https://github.com/libuv/libuv/pull/1428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
uv_interface_addresses API extracts the network interface entries.
In AIX, this was not fully implemented. retrieve the network mask and
the mac addresses.
Fixes: https://github.com/nodejs/node/issues/14119
PR-URL: https://github.com/libuv/libuv/pull/1410
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Should make the dreaded "%1 is not a valid Win32 application" error
message a thing of the past.
PR-URL: https://github.com/libuv/libuv/pull/1116
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Out-of-band TCP messages are used for TCP data
transmission outside (outband) the inbound TCP
data. These packets are sent with an
"urgent pointer", but previously discarded.
Additionally, when using (e)poll a POLLPRI is
triggered when an interrupt signal is received
on GPIO capable systems such as the Raspberry Pi.
PR-URL: https://github.com/libuv/libuv/pull/1040
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Ensures that the user's argv is copied into a local buffer when calling
uv_setup_args. Before, the argv was simply being pointed to, which
meant that libuv could end up accessing invalid memory if the user
decided to later edit the memory at that location. It also meant that a
subsequent call to uv_set_process_title would never write more
characters than the length of argv[0].
With the new changes, argv[0] is copied into a temporary buffer and any
subsequent calls to uv_set_process_title will thus be able to copy as
many characters as the call to uv__strdup permits. Note that on *BSD
and AIX this behaviour was already in effect .
Some error checking (specifically checking the result of uv__strdup)
has been added, and calls to uv__free rearranged so that in case of
ENOMEM uv__free can't be called erroneously.
Fixes: https://github.com/libuv/libuv/issues/1395
PR-URL: https://github.com/libuv/libuv/pull/1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add a small warning about uv_get_process_title()
and uv_set_process_title() not being thread safe on platforms
other than Windows. Also add a reminder for users to call
uv_setup_args() first.
Fixes: https://github.com/libuv/libuv/issues/1395
PR-URL: https://github.com/libuv/libuv/pull/1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fixes segfault of unit test on musl (AlpineLinux).
Add a check for parameter like uv_os_setenv do.
PR-URL: https://github.com/libuv/libuv/pull/1409
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Changes since version 1.12.0:
* Now working on version 1.12.1 (cjihrig)
* unix: avoid segfault in uv_get_process_title (Michele Caini)
* build: add a comma to uv.gyp (Gemini Wen)
* win: restore file pos after positional read/write (Bartosz Sosnowski)
* unix,stream: return error on closed handle passing (Santiago Gimeno)
* unix,benchmark: use fd instead of FILE* after fork (jBarz)
* zos: avoid compiler warnings (jBarz)
* win,pipe: race condition canceling readfile thread (Jameson Nash)
* sunos: filter out non-IPv4/IPv6 interfaces (Sebastian Wiedenroth)
* sunos: fix cmpxchgi and cmpxchgl type error (Sai Ke WANG)
* unix: reset signal disposition before execve() (Ben Noordhuis)
* unix: reset signal mask before execve() (Ben Noordhuis)
* unix: fix POLLIN assertion on server read (jBarz)
* zos: use stckf builtin for high-res timer (jBarz)
* win,udp: implements uv_udp_try_send (Barnabas Gema)
* win,udp: return UV_EINVAL instead of aborting (Romain Caire)
* freebsd: replace kvm with sysctl (Robert Ayrapetyan)
* aix: fix un-initialized pointer field in fs handle (Gireesh Punathil)
* win,build: support building with VS2017 (Refael Ackermann)
* doc: add instructions for building on Windows (Refael Ackermann)
* doc: format README (Refael Ackermann)
On AIX, uv_fs_event_start() didn't always initialize
handle->dir_filename. In this scenario, uv_fs_event_stop()
would free the uninitialized pointer. This commit
initialized handle->dir_filename to NULL in all cases.
Fixes: https://github.com/nodejs/node/issues/13577
PR-URL: https://github.com/libuv/libuv/pull/1400
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Instead of gettimeofday which is too heavy for a fast
monotonic clock implementation.
PR-URL: https://github.com/libuv/libuv/pull/1394
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Certain systems like z/OS have more than one bit turned
on for POLLIN events. (e.g. #define POLLIN 0x03).
Asserting that all bits are turned on would be invalid.
Instead, assert that *any* of those bits are turned on.
PR-URL: https://github.com/libuv/libuv/pull/1390
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Like the previous commit, except now the signal mask is reset instead
of the signal disposition. This does open a race window where blocked
signals can get delivered in the interval between the pthread_sigmask()
call and the execve() call (and may end up terminating the process) but
that cannot be helped; the same caveat applies to the previous commit.
Fixes: https://github.com/nodejs/node/issues/13662
PR-URL: https://github.com/libuv/libuv/pull/1376
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Signal dispositions are inherited by child processes. Libuv itself
does not touch them (if you don't use uv_signal_start(), that is)
but the embedder might and probably does in the case of SIGPIPE.
Reset the disposition for signals 1-31 to their defaults right before
execve'ing into the new process.
Fixes: https://github.com/nodejs/node/issues/13662
PR-URL: https://github.com/libuv/libuv/pull/1376
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
atomic_cas_ptr() is for compare-and-swap pointer addresses.
So when building 64 bit:
1. `ptr` is used casted to a pointer value (4-byte into 8-byte).
2. atomic_cas_ptr reads 8-byte at `ptr` and returns
In the case of `uv_async_send`, if handle->pending is 0, cmpxchgi()
actually returns the value of the 4-bytes past handle->pending,
causing uv__async_send to never be called.
The modified test-async-null-cb.c hangs at uv_run in this case.
PR-URL: https://github.com/libuv/libuv/pull/1361
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Filter out anything that is not an IPv4 or IPv6 interface in
uv_interface_addresses().
PR-URL: https://github.com/libuv/libuv/pull/1387
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fixes a race condition where if uv_read_stop was called shortly
after uv_read_start or a successful read and before the
uv_pipe_zero_readfile_thread_proc thread started,
that thread would call the blocking ReadFile call after the
HANDLE_READING flag had already been cleared.
Also ignores EINTR to be more consistent with unix
(although we generally don't expect to see this condition on windows).
PR-URL: https://github.com/libuv/libuv/pull/1322
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Some of these compiler flags are not supported. So don't
use them.
PR-URL: https://github.com/libuv/libuv/pull/1373
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The FILE* object is not guaranteed to be in the same state after
a fork. Instead store the file descriptor instead and use that in
the child process.
PR-URL: https://github.com/libuv/libuv/pull/1369
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
File read or write from specified position will move file pointer on
Windows but not on POSIX. This makes Windows behave as other
supported platforms.
Ref: https://github.com/nodejs/node/issues/9671
PR-URL: https://github.com/libuv/libuv/pull/1357
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
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>