libuv.git
2 days agowin, fs: mkdir return UV_EINVAL for invalid names v1.x
Bartosz Sosnowski [Thu, 11 Jul 2019 10:45:38 +0000 (12:45 +0200)]
win, fs: mkdir return UV_EINVAL for invalid names

Makes uv_fs_mkdir return UV_EINVAL for invalid filenames instead of
UV_ENOENT.

Ref: https://github.com/nodejs/node/issues/28599

PR-URL: https://github.com/libuv/libuv/pull/2375
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 days agowin: add UV_FS_O_FILEMAP
João Reis [Thu, 9 May 2019 00:18:05 +0000 (01:18 +0100)]
win: add UV_FS_O_FILEMAP

Reading and writing files using a memory file mapping can be
significantly faster on Windows.

PR-URL: https://github.com/libuv/libuv/pull/2295
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
6 days agowin: prevent tty event explosion machine hang
Javier Blazquez [Wed, 22 May 2019 03:23:42 +0000 (20:23 -0700)]
win: prevent tty event explosion machine hang

The tty subsystem on Windows was listening for console events from all
processes to detect when our console window was being resized. This
could cause an explosion in the number of events queued by the system
when running many console applications in parallel that all wrote to
their console quickly. The end result was a complete machine hang.

Now we determine, whenever possible, what our corresponding conhost.exe
process is and listen for console events from that process only. This
detection does not work in 32-bit applications running on 64-bit
Windows so those default to the old behavior of listening to all
processes.

PR-URL: https://github.com/libuv/libuv/pull/2308
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2 weeks agowin: fix uv_os_tmpdir when env var is 260 chars
Mustafa M [Wed, 19 Jun 2019 16:24:36 +0000 (12:24 -0400)]
win: fix uv_os_tmpdir when env var is 260 chars

When TMP environment variable is 261 chars (including the trailing
slash) or 260 chars without the trailing slash, uv_os_tmpdir throws an
UV_EIO error which it shouldn't, since the total input string size
allowable for this function is PATH_MAX+1 (including the trailing slash)

PR-URL: https://github.com/libuv/libuv/pull/2341
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2 weeks agowin,fs: don't modify global file translation mode
Javier Blazquez [Tue, 2 Jul 2019 10:01:29 +0000 (12:01 +0200)]
win,fs: don't modify global file translation mode

The MSVC runtime provides a global variable that can be used to set the
default file translation mode so that file open calls don't need to
explicitly specify that mode.

libuv was changing that global mode to binary from its default of text.
However, libuv doesn't actually need to do that anymore, and the
application may not want the default changed under it. This change stops
libuv from modifying that global mode.

PR-URL: https://github.com/libuv/libuv/pull/2324
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 weeks agoNow working on version 1.30.2
cjihrig [Tue, 2 Jul 2019 14:57:15 +0000 (10:57 -0400)]
Now working on version 1.30.2

Fixes: https://github.com/libuv/libuv/issues/2363

2 weeks agoAdd SHA to ChangeLog
cjihrig [Tue, 2 Jul 2019 14:55:04 +0000 (10:55 -0400)]
Add SHA to ChangeLog

2 weeks ago2019.07.03, Version 1.30.1 (Stable) v1.30.1
cjihrig [Tue, 2 Jul 2019 14:55:03 +0000 (10:55 -0400)]
2019.07.03, Version 1.30.1 (Stable)

Changes since version 1.30.0:

* doc: fix incorrect versionchanged (cjihrig)

* test: allow UV_ECONNRESET in tcp_try_write_error (cjihrig)

* unix: add uv_get_constrained_memory() cygwin stub (cjihrig)

* build: fix android cmake build (Ben Noordhuis)

* unix: squelch -Wcast-function-type warning (Ben Noordhuis)

* build: fix compile error with uClibc (zlargon)

2 weeks agobuild: fix compile error with uClibc
Leon Huang [Tue, 2 Jul 2019 09:56:58 +0000 (11:56 +0200)]
build: fix compile error with uClibc

uClibc does not have header "gnu/libc-version.h"

PR-URL: https://github.com/libuv/libuv/pull/2329
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 weeks agounix: squelch -Wcast-function-type warning 2346/head
Ben Noordhuis [Tue, 2 Jul 2019 09:36:06 +0000 (11:36 +0200)]
unix: squelch -Wcast-function-type warning

PR-URL: https://github.com/libuv/libuv/pull/2346
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 weeks agobuild: fix android cmake build 2362/head
Ben Noordhuis [Tue, 2 Jul 2019 09:34:25 +0000 (11:34 +0200)]
build: fix android cmake build

Fix two 'multiple definition' symbol errors caused by compiling in
sysinfo-memory.c when linux-core.c also provides them (and those
are the correct ones.)

Bug introduced in commit 3a1be725 ("linux: read free/total memory from
/proc/meminfo") released in libuv v1.29.0. It slipped under the radar
because there are no Android machines in our CI matrix.

Fixes: https://github.com/libuv/libuv/issues/2357
PR-URL: https://github.com/libuv/libuv/pull/2362
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 weeks agounix: add uv_get_constrained_memory() cygwin stub 2361/head
cjihrig [Mon, 1 Jul 2019 15:01:55 +0000 (11:01 -0400)]
unix: add uv_get_constrained_memory() cygwin stub

PR-URL: https://github.com/libuv/libuv/pull/2361
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 weeks agotest: allow UV_ECONNRESET in tcp_try_write_error 2355/head
cjihrig [Thu, 27 Jun 2019 17:27:34 +0000 (13:27 -0400)]
test: allow UV_ECONNRESET in tcp_try_write_error

Recent CI failures imply that uv_try_write() can return
UV_ECONNRESET - specifically on FreeBSD. This commit
updates the test to pass when that error code is returned.

PR-URL: https://github.com/libuv/libuv/pull/2355
Reviewed-By: Anna Henningsen <anna@addaleax.net>
3 weeks agodoc: fix incorrect versionchanged
cjihrig [Thu, 27 Jun 2019 14:27:24 +0000 (10:27 -0400)]
doc: fix incorrect versionchanged

Version 1.29.2 never happened. Update the versionchanged from
9a10058e72fb62c3e6ffd82e1f3f393c717e63f5 to be 1.30.0.

PR-URL: https://github.com/libuv/libuv/pull/2354
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 weeks agoNow working on version 1.30.1
cjihrig [Thu, 27 Jun 2019 14:20:17 +0000 (10:20 -0400)]
Now working on version 1.30.1

Fixes: https://github.com/libuv/libuv/issues/2343

3 weeks agoAdd SHA to ChangeLog
cjihrig [Thu, 27 Jun 2019 14:18:47 +0000 (10:18 -0400)]
Add SHA to ChangeLog

3 weeks ago2019.06.28, Version 1.30.0 (Stable) v1.30.0
cjihrig [Thu, 27 Jun 2019 14:18:46 +0000 (10:18 -0400)]
2019.06.28, Version 1.30.0 (Stable)

Changes since version 1.29.1:

* darwin: fall back to F_BARRIERFSYNC (Ben Noordhuis)

* darwin: add 32 bit close$NOCANCEL implementation
  (ken-cunningham-webuse)

* build, core, unix: add support for Haiku (Leorize)

* darwin,linux: more conservative minimum stack size (Ben Noordhuis)

* threadpool: increase UV_THREADPOOL_SIZE limit (Vlad A)

* unix: return actual error from `uv_try_write()` (Anna Henningsen)

* darwin: fix build error with macos 10.10 (Ben Noordhuis)

* unix: make uv_cwd() report UV_ENOBUFS (Ben Noordhuis)

* unix: make uv_fs_read() fill all buffers (Ben Noordhuis)

* test: give hrtime test a custom 10s timeout (Ben Noordhuis)

* fs: fix uv_fs_copyfile if same src and dst (Santiago Gimeno)

* build: add cmake option to skip building tests (Niels Lohmann)

* doc: add link to nodejs.org (Jenil Christo)

* unix: fix a comment typo in signal.c (Evgeny Ermakov)

* unix: remove redundant cast in process.c (gengjiawen)

* doc: fix wrong mutex function prototypes (Leo Chung)

3 weeks agodoc: fix wrong mutex function prototypes
Leo Chung [Wed, 19 Jun 2019 04:46:55 +0000 (12:46 +0800)]
doc: fix wrong mutex function prototypes

The `:lines:` numbers were wrong, they showed the signatures of the
uv_fs_access and uv_fs_chmod functions.

3 weeks agounix: remove redundant cast in process.c
gengjiawen [Sun, 19 May 2019 14:32:30 +0000 (22:32 +0800)]
unix: remove redundant cast in process.c

PR-URL: https://github.com/libuv/libuv/pull/2300
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 weeks agounix: fix a comment typo in signal.c
Evgeny Ermakov [Wed, 29 May 2019 15:08:26 +0000 (02:08 +1100)]
unix: fix a comment typo in signal.c

PR-URL: https://github.com/libuv/libuv/pull/2318
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Vladimír Čunát <v@cunat.cz>
3 weeks agodoc: add link to nodejs.org
Jenil Christo [Thu, 6 Jun 2019 18:58:07 +0000 (00:28 +0530)]
doc: add link to nodejs.org

PR-URL: https://github.com/libuv/libuv/pull/2325
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 weeks agobuild: add cmake option to skip building tests
Niels Lohmann [Mon, 26 Nov 2018 19:12:35 +0000 (20:12 +0100)]
build: add cmake option to skip building tests

In case libuv is included via add_subdirectory, its tests are always
built and executed. This cannot be skipped currently, because switching
BUILD_TESTING to false would also switch off all other tests in the
parent project.

This commit adds a switch "libuv_buildtests" which can individually
switch of the compilation and execution of libuv's tests. It is ON by
default, so the default behavior does not change. However, projects
that include libuv via add_subdirectory can not set libuv_buildtests to
OFF if they are not interested in its tests.

PR-URL: https://github.com/libuv/libuv/pull/2094
Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 weeks agofs: fix uv_fs_copyfile if same src and dst
Santiago Gimeno [Fri, 17 May 2019 12:25:43 +0000 (14:25 +0200)]
fs: fix uv_fs_copyfile if same src and dst

Specifically return success.
It fixes a tight loop on unices as `sendfile()` was returning 0 and also
makes the function behave the same both on `unix` and `windows`.

It partially implements: https://github.com/libuv/libuv/issues/2237

PR-URL: https://github.com/libuv/libuv/pull/2298
Refs: https://github.com/nodejs/node/issues/27746
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 weeks agotest: give hrtime test a custom 10s timeout 2345/head
Ben Noordhuis [Fri, 21 Jun 2019 09:32:01 +0000 (11:32 +0200)]
test: give hrtime test a custom 10s timeout

The test is supposed to complete in about 3.5s but it can
hit the 5s timeout when run on a system with high load.

Fixes: https://github.com/libuv/libuv/issues/2342
PR-URL: https://github.com/libuv/libuv/pull/2345
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 weeks agounix: make uv_fs_read() fill all buffers 2338/head
Ben Noordhuis [Thu, 20 Jun 2019 10:05:59 +0000 (12:05 +0200)]
unix: make uv_fs_read() fill all buffers

The fallback for systems that lack preadv() only filled the first
buffer.

This commit rectifies that to fill all (or at least as many as possible)
buffers.

Fixes: https://github.com/libuv/libuv/issues/2332
PR-URL: https://github.com/libuv/libuv/pull/2338
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
4 weeks agounix: make uv_cwd() report UV_ENOBUFS 2335/head
Ben Noordhuis [Thu, 20 Jun 2019 10:04:16 +0000 (12:04 +0200)]
unix: make uv_cwd() report UV_ENOBUFS

Make uv_cwd() do what the documentation says it did when the destination
buffer is too small: report UV_ENOBUFS and set the `size` in/out param
to the size of the path including the trailing nul byte.

Fixes: https://github.com/libuv/libuv/issues/2333
PR-URL: https://github.com/libuv/libuv/pull/2335
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
4 weeks agodarwin: fix build error with macos 10.10 2334/head
Ben Noordhuis [Sat, 15 Jun 2019 10:45:25 +0000 (12:45 +0200)]
darwin: fix build error with macos 10.10

F_BARRIERFSYNC isn't defined when building on that platform.

PR-URL: https://github.com/libuv/libuv/pull/2334
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
5 weeks agounix: return actual error from `uv_try_write()`
Anna Henningsen [Fri, 31 May 2019 10:02:18 +0000 (12:02 +0200)]
unix: return actual error from `uv_try_write()`

So far, for some (?) errors, `uv_try_write()` returns `EAGAIN`
regardless of the actual error, so `ECONNRESET` and `EPIPE` errors
can be swallowed here.

This commit changes `uv_try_write()` so that it prefers to return
the actual error it has seen.

PR-URL: https://github.com/libuv/libuv/pull/2321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
5 weeks agothreadpool: increase UV_THREADPOOL_SIZE limit
Vlad A [Fri, 7 Jun 2019 08:59:44 +0000 (10:59 +0200)]
threadpool: increase UV_THREADPOOL_SIZE limit

Increase the UV_THREADPOOL_SIZE limit to 1024 and update the docs.

Fixes: https://github.com/libuv/libuv/pull/2296
PR-URL: https://github.com/libuv/libuv/pull/2314
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
5 weeks agodarwin,linux: more conservative minimum stack size 2310/head
Ben Noordhuis [Fri, 7 Jun 2019 07:58:49 +0000 (09:58 +0200)]
darwin,linux: more conservative minimum stack size

uv_thread_create() inspects min(PTHREAD_STACK_MIN, RLIMIT_STACK) to
find out the minimum allowed stack size. After spelunking through
kernel and libc code, I came to the conclusion that allowing such
small stacks does not mix well with signals.

Musl's PTHREAD_STACK_MIN is 2 KB but signal handlers on many
architectures need at least 1 KB to store the signal context,
making it almost impossible to do anything on the thread without
signal delivery overflowing the stack.

Therefore, increase the lower bound to 8 KB. That corresponds to
PTHREAD_STACK_MIN + MINSIGSTKSZ on arm64, which has the largest
MINSIGSTKSZ of the architectures that musl supports.

PR-URL: https://github.com/libuv/libuv/pull/2310
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
5 weeks agobuild, core, unix: add support for Haiku
Leorize [Fri, 7 Jun 2019 07:57:06 +0000 (09:57 +0200)]
build, core, unix: add support for Haiku

This commit add support for Haiku, an open-source operating system
inspired by BeOS.

PR-URL: https://github.com/libuv/libuv/pull/2301
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
5 weeks agodarwin: add 32 bit close$NOCANCEL implementation
ken-cunningham-webuse [Thu, 23 May 2019 19:35:14 +0000 (12:35 -0700)]
darwin: add 32 bit close$NOCANCEL implementation

The link symbol for close$NOCANCEL is slightly different for 32 bit
builds.

PR-URL: https://github.com/libuv/libuv/pull/2309
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
5 weeks agodarwin: fall back to F_BARRIERFSYNC 2317/head
Ben Noordhuis [Fri, 7 Jun 2019 07:38:28 +0000 (09:38 +0200)]
darwin: fall back to F_BARRIERFSYNC

Fall back to F_BARRIERFSYNC if F_FULLFSYNC is not supported by the file
system, only fall back to fsync() if both fcntls fail.

F_BARRIERFSYNC should be at least as safe as fsync() because it's fsync
coupled with a barrier.

PR-URL: https://github.com/libuv/libuv/pull/2317
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 weeks agoNow working on version 1.29.2
cjihrig [Tue, 21 May 2019 13:47:22 +0000 (09:47 -0400)]
Now working on version 1.29.2

Fixes: https://github.com/libuv/libuv/issues/2306

8 weeks agoAdd SHA to ChangeLog
cjihrig [Tue, 21 May 2019 13:44:45 +0000 (09:44 -0400)]
Add SHA to ChangeLog

8 weeks ago2019.05.22, Version 1.29.1 (Stable) v1.29.1
cjihrig [Tue, 21 May 2019 13:44:45 +0000 (09:44 -0400)]
2019.05.22, Version 1.29.1 (Stable)

Changes since version 1.29.0:

* unix: simplify uv/posix.h include logic (cjihrig)

* test: increase test timeout (cjihrig)

* linux: fix sscanf() overflows reading from /proc (Ben Noordhuis)

8 weeks agolinux: fix sscanf() overflows reading from /proc
Ben Noordhuis [Tue, 21 May 2019 07:54:28 +0000 (09:54 +0200)]
linux: fix sscanf() overflows reading from /proc

Use `"%" PRIu64` and uint64_t for sscanf-ing large values, not `"%lu"`
and unsigned long. The latter can overflow when libuv is a 32 bits
application running on a 64 bits machine.

Fixes: https://github.com/libuv/libuv/issues/2297
PR-URL: https://github.com/libuv/libuv/pull/2305
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 weeks agotest: increase test timeout 2304/head
cjihrig [Mon, 20 May 2019 16:36:31 +0000 (12:36 -0400)]
test: increase test timeout

The test threadpool_multiple_event_loops has been timing
out consistently on FreeBSD in the CI. This commit attempts
to mitigate the problem by extending the test timeout.

PR-URL: https://github.com/libuv/libuv/pull/2304
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
8 weeks agounix: simplify uv/posix.h include logic 2302/head
cjihrig [Mon, 20 May 2019 15:06:09 +0000 (11:06 -0400)]
unix: simplify uv/posix.h include logic

This commit includes uv/posix.h in one #elif instead of four.

PR-URL: https://github.com/libuv/libuv/pull/2302
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2 months agoNow working on 1.29.1
cjihrig [Wed, 15 May 2019 17:16:23 +0000 (13:16 -0400)]
Now working on 1.29.1

Fixes: https://github.com/libuv/libuv/issues/2293

2 months agoAdd SHA to ChangeLog
cjihrig [Wed, 15 May 2019 17:14:17 +0000 (13:14 -0400)]
Add SHA to ChangeLog

2 months ago2019.05.16, Version 1.29.0 (Stable) v1.29.0
cjihrig [Wed, 15 May 2019 17:14:17 +0000 (13:14 -0400)]
2019.05.16, Version 1.29.0 (Stable)

Changes since version 1.28.0:

* ibmi: read memory and CPU usage info (Xu Meng)

* doc: update the cmake testing instruction (zlargon)

* unix: fix race condition in uv_async_send() (Ben Noordhuis)

* linux: use O_CLOEXEC instead of EPOLL_CLOEXEC (Ben Noordhuis)

* doc: mark uv_async_send() as async-signal-safe (Ben Noordhuis)

* linux: init st_flags and st_gen when using statx (Oscar Waddell)

* linux: read free/total memory from /proc/meminfo (Ben Noordhuis)

* test: test zero-sized uv_fs_sendfile() writes (Ben Noordhuis)

* unix: don't assert on UV_PROCESS_WINDOWS_* flags (Ben Noordhuis)

* linux: set correct mac address for IP-aliases (Santiago Gimeno)

* win,util: fix null pointer dereferencing (Tobias Nießen)

* unix,win: fix `uv_fs_poll_stop()` when active (Anna Henningsen)

* doc: add missing uv_fs_type entries (Michele Caini)

* doc: fix build with sphinx 2.x (FX Coudert)

* unix: don't make statx system call on Android (George Zhao)

* unix: fix clang scan-build warning (Kyle Edwards)

* unix: fall back to kqueue on older macOS systems
  (ken-cunningham-webuse)

* unix,win: add uv_get_constrained_memory() (Kelvin Jin)

* darwin: fix thread cancellation fd leak (Ben Noordhuis)

* linux: fix thread cancellation fd leak (Ben Noordhuis)

2 months agolinux: fix thread cancellation fd leak
Ben Noordhuis [Sat, 4 May 2019 11:46:14 +0000 (13:46 +0200)]
linux: fix thread cancellation fd leak

Same as the previous commit but this time for Linux.

Specifically, the glibc close() wrapper is a cancellation point;
the thread is unwound when close() is called when the thread is
in the "cancel" state.

That's according to spec and therefore arguably less severe than
MacOS's "EINTR without actually closing" behavior but we can avoid
the file descriptor leak altogether by sidestepping glibc and
making the system call directly.

Musl libc is unaffected, its close() wrapper doesn't check
the cancel state.

PR-URL: https://github.com/libuv/libuv/pull/2291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agodarwin: fix thread cancellation fd leak
Ben Noordhuis [Sat, 4 May 2019 11:46:14 +0000 (13:46 +0200)]
darwin: fix thread cancellation fd leak

The close() system call tests for thread cancellation first. That has
the unfortunate side effect of aborting the sytem call with EINTR
without actually closing the file descriptor when the thread is in
the "cancel" state. Work around that by calling close$NOCANCEL().

This might well qualify as an academic bug because approximately no one
uses thread cancellation but let's aim for correctness anyway.

PR-URL: https://github.com/libuv/libuv/pull/2291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix,win: add uv_get_constrained_memory()
Kelvin Jin [Wed, 1 May 2019 20:54:56 +0000 (13:54 -0700)]
unix,win: add uv_get_constrained_memory()

Fixes: https://github.com/libuv/libuv/issues/2286
PR-URL: https://github.com/libuv/libuv/pull/2289
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix: fall back to kqueue on older macOS systems
ken-cunningham-webuse [Fri, 3 May 2019 22:02:33 +0000 (15:02 -0700)]
unix: fall back to kqueue on older macOS systems

Newer macOS systems (10.7+) use fsevents() for the fs_event backend,
but older macOS systems don't have full functionality for this in
the macOS fsevents() API. Fall back to kqueue for these systems.

PR-URL: https://github.com/libuv/libuv/pull/2290
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix: fix clang scan-build warning
Kyle Edwards [Fri, 11 Jan 2019 20:59:51 +0000 (15:59 -0500)]
unix: fix clang scan-build warning

When building libuv with clang scan-build, an "Assigned value is
garbage or undefined" warning is emitted unless the return value
of open() is verified to be >= 0. This commit fixes the warning.

PR-URL: https://github.com/libuv/libuv/pull/2140
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agounix: don't make statx system call on Android
George Zhao [Fri, 26 Apr 2019 13:18:40 +0000 (21:18 +0800)]
unix: don't make statx system call on Android

Fixes: https://github.com/libuv/libuv/issues/2282
PR-URL: https://github.com/libuv/libuv/pull/2284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agodoc: fix build with sphinx 2.x
FX Coudert [Tue, 16 Apr 2019 19:48:07 +0000 (21:48 +0200)]
doc: fix build with sphinx 2.x

app.info() was deprecated on Jan 4, 2017 (sphinx-doc/sphinx#3267),
and removed as of Sphinx 2.0.0. This commit removes the usage of
app.info().

PR-URL: https://github.com/libuv/libuv/pull/2265
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agodoc: add missing uv_fs_type entries
Michele Caini [Wed, 24 Apr 2019 11:23:19 +0000 (13:23 +0200)]
doc: add missing uv_fs_type entries

PR-URL: https://github.com/libuv/libuv/pull/2280
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix,win: fix `uv_fs_poll_stop()` when active
Anna Henningsen [Fri, 3 May 2019 16:33:13 +0000 (18:33 +0200)]
unix,win: fix `uv_fs_poll_stop()` when active

Fix `uv_fs_poll_stop()` for active handles by not attempting to
mark the `uv_fs_poll_t` handle as closing when `uv_close()`
hasn’t been called on it.

Fixes: https://github.com/libuv/libuv/issues/2287
PR-URL: https://github.com/libuv/libuv/pull/2288
Refs: https://github.com/libuv/libuv/pull/1875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agowin,util: fix null pointer dereferencing
Tobias Nießen [Tue, 16 Apr 2019 17:01:45 +0000 (19:01 +0200)]
win,util: fix null pointer dereferencing

If uv__calloc returns NULL, the function jumps to the error label and
attempts to access array elements of cpu_infos (which is NULL).

PR-URL: https://github.com/libuv/libuv/pull/2264
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agolinux: set correct mac address for IP-aliases
Santiago Gimeno [Wed, 10 Apr 2019 04:56:03 +0000 (06:56 +0200)]
linux: set correct mac address for IP-aliases

IP-alias format is the interface name followed by a colon and a string
(usually a number). Set the physical address to the one in the 'base'
interface.

PR-URL: https://github.com/libuv/libuv/pull/2248
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agounix: don't assert on UV_PROCESS_WINDOWS_* flags 2278/head
Ben Noordhuis [Tue, 23 Apr 2019 08:36:34 +0000 (10:36 +0200)]
unix: don't assert on UV_PROCESS_WINDOWS_* flags

UV_PROCESS_WINDOWS_HIDE_CONSOLE and UV_PROCESS_WINDOWS_HIDE_GUI were
whitelisted on Windows but not Unices. Now they are.

Bug introduced in commit 4c2dcca27 ("win: support more fine-grained
windows hiding") which I reviewed but where I failed to spot it. Mea
culpa.

Fixes: https://github.com/libuv/libuv/issues/2266
PR-URL: https://github.com/libuv/libuv/pull/2278
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Kyle Edwards <kyle.edwards@kitware.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agotest: test zero-sized uv_fs_sendfile() writes 2279/head
Ben Noordhuis [Tue, 23 Apr 2019 10:34:22 +0000 (12:34 +0200)]
test: test zero-sized uv_fs_sendfile() writes

This was reported as a bug in November 2018 but it appears to be working
now. Add a regression test to ensure it stays that way.

Fixes: https://github.com/libuv/libuv/issues/2076
PR-URL: https://github.com/libuv/libuv/pull/2279
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agolinux: read free/total memory from /proc/meminfo 2258/head
Ben Noordhuis [Tue, 23 Apr 2019 09:34:04 +0000 (11:34 +0200)]
linux: read free/total memory from /proc/meminfo

It was reported that uv_get_free_memory() and uv_get_total_memory()
report the wrong values inside an lxc container.

Libuv calls sysinfo(2) but that isn't intercepted by lxc. /proc/meminfo
however is because /proc is a FUSE fs inside the container.

This commit makes libuv try /proc/meminfo first and fall back to
sysinfo(2) in case /proc isn't mounted.

Fixes: https://github.com/libuv/libuv/issues/2249
PR-URL: https://github.com/libuv/libuv/pull/2258
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agolinux: init st_flags and st_gen when using statx
Oscar Waddell [Tue, 23 Apr 2019 09:26:47 +0000 (11:26 +0200)]
linux: init st_flags and st_gen when using statx

Explicitly initialize uv_stat_t fields st_flags and st_gen when using
statx as uv__to_stat does when statx is not available. This makes
valgrind happier.

PR-URL: https://github.com/libuv/libuv/pull/2263
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2 months agodoc: mark uv_async_send() as async-signal-safe 2273/head
Ben Noordhuis [Mon, 22 Apr 2019 14:05:50 +0000 (16:05 +0200)]
doc: mark uv_async_send() as async-signal-safe

Refs: https://github.com/libuv/libuv/issues/2173
PR-URL: https://github.com/libuv/libuv/pull/2273
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agolinux: use O_CLOEXEC instead of EPOLL_CLOEXEC 2272/head
Ben Noordhuis [Mon, 22 Apr 2019 13:50:34 +0000 (15:50 +0200)]
linux: use O_CLOEXEC instead of EPOLL_CLOEXEC

It was reported that EPOLL_CLOEXEC is not defined on Android API < 21,
a.k.a. Lollipop. Since EPOLL_CLOEXEC is an alias for O_CLOEXEC on all
architectures, we just use that instead.

Fixes: https://github.com/libuv/libuv/issues/2167
PR-URL: https://github.com/libuv/libuv/pull/2272
Refs: https://github.com/libuv/libuv/pull/2216
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix: fix race condition in uv_async_send() 2231/head
Ben Noordhuis [Tue, 26 Mar 2019 01:06:32 +0000 (02:06 +0100)]
unix: fix race condition in uv_async_send()

After inspection of the code, it seems like there is a race window
between the cmpxchgi() and uv__async_send() calls.

If the event loop thread is already busy looping over the async handles,
it can invoke the callback - which in turn can close the handle - before
the other thread reaches the uv__async_send() call. That's bad because
it accesses the handle that at that point might not be valid anymore.

Fix that by introducing an ad hoc spinlock that blocks the event loop
thread until the sending thread is done. It's not pretty or elegant
but it fixes the immediate bug and appears to have no measurable
impact on the async handle benchmarks.

Fixes: https://github.com/libuv/libuv/issues/2226
PR-URL: https://github.com/libuv/libuv/pull/2231
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agodoc: update the cmake testing instruction
Leon Huang [Wed, 10 Apr 2019 22:00:10 +0000 (18:00 -0400)]
doc: update the cmake testing instruction

PR-URL: https://github.com/libuv/libuv/pull/2253
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agoibmi: read memory and CPU usage info
Xu Meng [Mon, 15 Apr 2019 15:35:34 +0000 (10:35 -0500)]
ibmi: read memory and CPU usage info

PR-URL: https://github.com/libuv/libuv/pull/2261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agoNow working on 1.28.1
cjihrig [Mon, 15 Apr 2019 15:21:31 +0000 (11:21 -0400)]
Now working on 1.28.1

Fixes: https://github.com/libuv/libuv/issues/2228

3 months agoAdd SHA to ChangeLog
cjihrig [Mon, 15 Apr 2019 15:19:27 +0000 (11:19 -0400)]
Add SHA to ChangeLog

3 months ago2019.04.16, Version 1.28.0 (Stable) v1.28.0
cjihrig [Mon, 15 Apr 2019 15:19:26 +0000 (11:19 -0400)]
2019.04.16, Version 1.28.0 (Stable)

Changes since version 1.27.0:

* unix,win: add uv_gettimeofday() (cjihrig)

* unix,win: add uv_fs_{open,read,close}dir() (cjihrig)

* unix: fix uv_interface_addresses() (Andreas Rohner)

* fs: remove macOS-specific copyfile(3) (Rich Trott)

* fs: add test for copyfile() respecting permissions (Rich Trott)

* build: partially revert 5234b1c43a (Ben Noordhuis)

* zos: fix setsockopt error when using AF_UNIX (Milad Farazmand)

* unix: suppress EINTR/EINPROGRESS in uv_fs_close() (Ben Noordhuis)

* build: use cmake APPLE variable to detect platform (zlargon)

* distcheck: remove duplicate test/ entry (Jameson Nash)

* unix: remove unused cmpxchgl() function (Ben Noordhuis)

* unix: support sockaddr_un in uv_udp_send() (Yury Selivanov)

* unix: guard use of PTHREAD_STACK_MIN (Kamil Rytarowski)

* unix,win: introduce uv_timeval64_t (cjihrig)

* doc: document uv_timeval_t and uv_timeval64_t (cjihrig)

3 months agodoc: document uv_timeval_t and uv_timeval64_t 2246/head
cjihrig [Thu, 11 Apr 2019 18:07:22 +0000 (14:07 -0400)]
doc: document uv_timeval_t and uv_timeval64_t

PR-URL: https://github.com/libuv/libuv/pull/2246
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agounix,win: introduce uv_timeval64_t
cjihrig [Mon, 8 Apr 2019 00:09:03 +0000 (20:09 -0400)]
unix,win: introduce uv_timeval64_t

Fixes: https://github.com/libuv/libuv/issues/2243
PR-URL: https://github.com/libuv/libuv/pull/2246
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agounix: guard use of PTHREAD_STACK_MIN
Kamil Rytarowski [Wed, 10 Apr 2019 22:19:22 +0000 (00:19 +0200)]
unix: guard use of PTHREAD_STACK_MIN

PTHREAD_STACK_MIN is an optional part of the POSIX spec and
NetBSD deliberately does not implement it as it's a variable
value in runtime.

PR-URL: https://github.com/libuv/libuv/pull/2252
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agounix: support sockaddr_un in uv_udp_send()
Yury Selivanov [Sun, 17 Mar 2019 19:23:23 +0000 (15:23 -0400)]
unix: support sockaddr_un in uv_udp_send()

PR-URL: https://github.com/libuv/libuv/pull/2220
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agounix: remove unused cmpxchgl() function
Ben Noordhuis [Tue, 26 Mar 2019 00:32:12 +0000 (01:32 +0100)]
unix: remove unused cmpxchgl() function

PR-URL: https://github.com/libuv/libuv/pull/2230
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agodistcheck: remove duplicate test/ entry
Jameson Nash [Tue, 26 Mar 2019 00:56:37 +0000 (20:56 -0400)]
distcheck: remove duplicate test/ entry

It can be confusing to distcheck that we list it explicitly,
since it already adds it automatically, and we have configure
and build products in there.

Fixes: https://github.com/libuv/libuv/issues/2199
Refs: https://github.com/libuv/libuv/issues/2198
PR-URL: https://github.com/libuv/libuv/pull/2229
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agobuild: use cmake APPLE variable to detect platform
zlargon [Sun, 7 Apr 2019 16:47:04 +0000 (12:47 -0400)]
build: use cmake APPLE variable to detect platform

- CMake 3.14: supports Cross Compiling for iOS, tvOS, or watchOS
  using simple toolchain files.
  https://cmake.org/cmake/help/v3.14/release/3.14.html#platforms

- CMake 3.10: APPLE variable set to TURE when the target system
  is an Apple platform (macOS, iOS, tvOS or watchOS).
  https://cmake.org/cmake/help/v3.10/variable/APPLE.html

- CMake 3.0: APPLE variable support since v3.0.
  https://cmake.org/cmake/help/v3.0/variable/APPLE.html

PR-URL: https://github.com/libuv/libuv/pull/2245
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agounix: suppress EINTR/EINPROGRESS in uv_fs_close()
Ben Noordhuis [Fri, 29 Mar 2019 14:29:49 +0000 (15:29 +0100)]
unix: suppress EINTR/EINPROGRESS in uv_fs_close()

close() is interruptible, meaning that a signal delivered when the
close() system call is executing, can result in a return value of
-1 with errno set to EINTR or EINPROGRESS. A survey of supported
Unices suggests the file descriptor is in fact closed and so there
is nothing to do except ignore the error.

Libuv already handled it correctly for internal file descriptors
throug uv__close() and uv__close_nocheckstdio() but uv_fs_close()
did not until now.

PR-URL: https://github.com/libuv/libuv/pull/2236
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
3 months agozos: fix setsockopt error when using AF_UNIX
Milad Farazmand [Fri, 22 Mar 2019 17:20:38 +0000 (13:20 -0400)]
zos: fix setsockopt error when using AF_UNIX

PR-URL: https://github.com/libuv/libuv/pull/2224
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Yury Selivanov <yury@magic.io>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agobuild: partially revert 5234b1c43a
Ben Noordhuis [Wed, 27 Mar 2019 09:35:55 +0000 (10:35 +0100)]
build: partially revert 5234b1c43a

This undoes the changes commit 5234b1c4 ("build,sunos: better handling
of non-GCC compiler") makes to configure.ac and Makefile.am because they
break the build on the centos6 buildbots with the following error:

    # <snip>
    checking for _FILE_OFFSET_BITS value needed for large files... no
    ./configure: line 12957: syntax error near unexpected token `;'
    ./configure: line 12957: `; then'
    Build step 'Execute shell' marked build as failure

Refs: https://github.com/libuv/libuv/pull/2200
PR-URL: https://github.com/libuv/libuv/pull/2234
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agofs: add test for copyfile() respecting permissions
Rich Trott [Wed, 27 Mar 2019 15:36:25 +0000 (08:36 -0700)]
fs: add test for copyfile() respecting permissions

Add test to test-fs-copyfile.c to check that uv_fs_copyfile() respects
destination file permissions. Previously, in macOS, it did not.

PR-URL: https://github.com/libuv/libuv/pull/2233
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
3 months agofs: remove macOS-specific copyfile(3)
Rich Trott [Wed, 27 Mar 2019 06:12:13 +0000 (23:12 -0700)]
fs: remove macOS-specific copyfile(3)

Using copyfile(3) on macOS apparently results in situations where file
permissions are ignored. Using the same code for other UNIX-like
operating systems seems to fix the issue.

Refs: https://github.com/nodejs/node/issues/26936#issuecomment-476992597
PR-URL: https://github.com/libuv/libuv/pull/2233
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
3 months agounix: fix uv_interface_addresses()
Andreas Rohner [Sun, 13 Jan 2019 22:09:22 +0000 (23:09 +0100)]
unix: fix uv_interface_addresses()

The memset() in the inner loop clears previously copied phys_addrs. As a
result, every interface is reported to have a phys_addr of
00:00:00:00:00:00, except the last one. This bug only manifests on
systems with multiple interfaces.

PR-URL: https://github.com/libuv/libuv/pull/2153
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agounix,win: add uv_fs_{open,read,close}dir() 2057/head
cjihrig [Fri, 30 Jan 2015 19:04:03 +0000 (11:04 -0800)]
unix,win: add uv_fs_{open,read,close}dir()

Co-authored-by: Julien Gilli <jgilli@nodejs.org>
Co-authored-by: Jeremy Whitlock <jwhitlock@apache.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/libuv/libuv/pull/2057
Refs: https://github.com/joyent/libuv/issues/1430
Refs: https://github.com/joyent/libuv/pull/1521
Refs: https://github.com/joyent/libuv/pull/1574
Refs: https://github.com/libuv/libuv/pull/175
Refs: https://github.com/nodejs/node/issues/583
Refs: https://github.com/libuv/libuv/pull/416
Refs: https://github.com/libuv/libuv/issues/170

3 months agounix,win: add uv_gettimeofday() 2221/head
cjihrig [Mon, 18 Mar 2019 21:41:13 +0000 (17:41 -0400)]
unix,win: add uv_gettimeofday()

PR-URL: https://github.com/libuv/libuv/pull/2221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agoNow working on version 1.27.1
cjihrig [Sat, 16 Mar 2019 18:35:15 +0000 (14:35 -0400)]
Now working on version 1.27.1

Fixes: https://github.com/libuv/libuv/issues/2213

4 months agoAdd SHA to ChangeLog
cjihrig [Sat, 16 Mar 2019 18:31:48 +0000 (14:31 -0400)]
Add SHA to ChangeLog

4 months ago2019.03.17, Version 1.27.0 (Stable) v1.27.0
cjihrig [Sat, 16 Mar 2019 18:31:48 +0000 (14:31 -0400)]
2019.03.17, Version 1.27.0 (Stable)

Changes since version 1.26.0:

* doc: describe unix signal handling better (Vladimír Čunát)

* linux: use statx() to obtain file birth time (Ben Noordhuis)

* src: fill sockaddr_in6.sin6_len when it's defined (Santiago Gimeno)

* test: relax uv_hrtime() test assumptions (Ben Noordhuis)

* build: make cmake install LICENSE only once (Thomas Karl Pietrowski)

* bsd: plug uv_fs_event_start() error path fd leak (Ben Noordhuis)

* unix: fix __FreeBSD_kernel__ typo (cjihrig)

* doc: add note about uv_run() not being reentrant (Ben Noordhuis)

* unix, win: make fs-poll close wait for resource cleanup (Anna
  Henningsen)

* doc: fix typo in uv_thread_options_t definition (Ryan Liptak)

* win: skip winsock initialization in safe mode (evgley)

* unix: refactor getsockname/getpeername methods (Santiago Gimeno)

* win,udp: allow to use uv_udp_open on bound sockets (Santiago Gimeno)

* udp: add support for UDP connected sockets (Santiago Gimeno)

* build: fix uv_test shared uv Windows cmake build (ptlomholt)

* build: add android-configure scripts to EXTRA_DIST (Ben Noordhuis)

* build: add missing header (cjihrig)

* sunos: add perror() output prior to abort() (Andrew Paprocki)

* test,sunos: disable UV_DISCONNECT handling (Andrew Paprocki)

* sunos: disable __attribute__((unused)) (Andrew Paprocki)

* test,sunos: use unistd.h code branch (Andrew Paprocki)

* build,sunos: better handling of non-GCC compiler (Andrew Paprocki)

* test,sunos: fix statement not reached warnings (Andrew Paprocki)

* sunos: fix argument/prototype mismatch in atomics (Andrew Paprocki)

* test,sunos: test-ipc.c lacks newline at EOF (Andrew Paprocki)

* test: change spawn_stdin_stdout return to void (Andrew Paprocki)

* test: remove call to floor() in test driver (Andrew Paprocki)

4 months agotest: remove call to floor() in test driver
Andrew Paprocki [Sun, 3 Mar 2019 19:53:43 +0000 (14:53 -0500)]
test: remove call to floor() in test driver

Using `floor()` instead of integer division causes the test driver
to require linking against `libm` on Solaris.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agotest: change spawn_stdin_stdout return to void
Andrew Paprocki [Sun, 3 Mar 2019 19:45:56 +0000 (14:45 -0500)]
test: change spawn_stdin_stdout return to void

The return type is changed to avoid having to craft an artificial
`return` just for the Studio compiler.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agotest,sunos: test-ipc.c lacks newline at EOF
Andrew Paprocki [Thu, 21 Feb 2019 15:43:30 +0000 (10:43 -0500)]
test,sunos: test-ipc.c lacks newline at EOF

The Studio compiler issues a warning because the source file lacks a
newline at the end of the file.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agosunos: fix argument/prototype mismatch in atomics
Andrew Paprocki [Thu, 21 Feb 2019 15:38:49 +0000 (10:38 -0500)]
sunos: fix argument/prototype mismatch in atomics

The `atomic_cas_uint` and `atomic_cas_ulong` functions expect `uint_t`
and `ulong_t` parameters, respectively, so cast the `int`/`long` inputs
to avoid loud compiler warnings.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agotest,sunos: fix statement not reached warnings
Andrew Paprocki [Thu, 21 Feb 2019 15:34:01 +0000 (10:34 -0500)]
test,sunos: fix statement not reached warnings

The Studio C compiler issues a warning if there is a `return` after an
`abort()` call or an unreachable `return` after a prior `return`.

The Studio C compiler issues a warning if there is a `return` after a
prior `return`, or an endless loop (e.g., `for (;;)`) with a `return` at
the end of the function.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agobuild,sunos: better handling of non-GCC compiler
Andrew Paprocki [Thu, 21 Feb 2019 15:24:01 +0000 (10:24 -0500)]
build,sunos: better handling of non-GCC compiler

`AC_PROG_CC` sets the `GCC` shell variable, which is supposed to be
used to enable GCC-specific options.  A `GCC` check is added to only
pass the pre-existing GCC-specific options when using GCC.

The `GCC` variable is passed as an `AM_CONDITIONAL` and is used in
`Makefile.am` is used to address the following:

- Only pass `-pthreads` on `SUNOS` when using GCC
- Only use `-Wno-long-long` when using GCC

With the above changes, the Solaris build is now fixed when using the
native Studio compiler along with the minor adjustments:

- Always pass `-D_REENTRANT` to get thread-safe `errno`

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agotest,sunos: use unistd.h code branch
Andrew Paprocki [Thu, 21 Feb 2019 15:20:45 +0000 (10:20 -0500)]
test,sunos: use unistd.h code branch

Tests do not compile when selecting the non-`unistd.h` branch.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agosunos: disable __attribute__((unused))
Andrew Paprocki [Thu, 21 Feb 2019 15:18:06 +0000 (10:18 -0500)]
sunos: disable __attribute__((unused))

The Studio compiler prints out a warning when this attribute is used
because it does not support it (at least as of the latest 12.6 version):
https://docs.oracle.com/cd/E77782_01/html/E77788/gjzke.html#scrolltoc

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agotest,sunos: disable UV_DISCONNECT handling
Andrew Paprocki [Thu, 21 Feb 2019 15:16:08 +0000 (10:16 -0500)]
test,sunos: disable UV_DISCONNECT handling

Solaris does not support the non-standard Linux `POLLRDHUP` event, so
disable the code awaiting the disconnects to exit the loop.  Without
this, the `poll_duplex` and `poll_unidirectional` tests will hang and
timeout.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agosunos: add perror() output prior to abort()
Andrew Paprocki [Thu, 21 Feb 2019 13:34:15 +0000 (08:34 -0500)]
sunos: add perror() output prior to abort()

There are three `abort()` calls within the I/O subsystem related to
Solaris ports (`port_associate()`, `port_dissociate()`, and
`port_getn()`).  To simplify debugging issues where the kernel is
setting `errno` and returning failure, call `perror()` to see the
`errno` value cause of the failure.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agobuild: add missing header 2219/head
cjihrig [Sat, 16 Mar 2019 16:39:45 +0000 (12:39 -0400)]
build: add missing header

Refs: https://github.com/libuv/libuv/pull/2198#issuecomment-466118047
PR-URL: https://github.com/libuv/libuv/pull/2219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
4 months agobuild: add android-configure scripts to EXTRA_DIST
Ben Noordhuis [Thu, 21 Feb 2019 11:44:30 +0000 (12:44 +0100)]
build: add android-configure scripts to EXTRA_DIST

Commit baa81465a ("build: add compile for android arm64/x86/x86-64")
introduced a number of new android-configure scripts but didn't add
them to EXTRA_DIST in Makefile.am, causing `make dist` to fail.

This commit also removes checkspare.sh from EXTRA_DIST. I broke that
in commit a7a16219d ("unix: remove checksparse.sh") from last June.
Mea culpa!

Fixes: https://github.com/libuv/libuv/issues/2190
PR-URL: https://github.com/libuv/libuv/pull/2198
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agobuild: fix uv_test shared uv Windows cmake build
Poul Thomas Lomholt [Tue, 12 Feb 2019 22:54:05 +0000 (14:54 -0800)]
build: fix uv_test shared uv Windows cmake build

This commit fixes a linker error when building tests
via cmake on Windows by adding the proper
USING_UV_SHARED=1 define when linking to the shared
libuv.

Fixes: https://github.com/libuv/libuv/issues/2188
PR-URL: https://github.com/libuv/libuv/pull/2187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agoudp: add support for UDP connected sockets
Santiago Gimeno [Mon, 20 Mar 2017 10:32:25 +0000 (11:32 +0100)]
udp: add support for UDP connected sockets

Add two new methods:

`uv_udp_connect()` to connect / disconnect an UDP handle.
`uv_udp_getpeername()` to get the remote peer address of a connected UDP
handle.

Modify `uv_udp_send()` and `uv_udp_try_send()` to accept a `NULL` `addr`
to send messages over an "UDP connection".

Refs: https://github.com/libuv/leps/pull/10
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agowin,udp: allow to use uv_udp_open on bound sockets
Santiago Gimeno [Wed, 6 Jun 2018 21:15:03 +0000 (23:15 +0200)]
win,udp: allow to use uv_udp_open on bound sockets

PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agounix: refactor getsockname/getpeername methods
Santiago Gimeno [Thu, 31 May 2018 20:44:07 +0000 (22:44 +0200)]
unix: refactor getsockname/getpeername methods

PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agowin: skip winsock initialization in safe mode
evgley [Sun, 24 Feb 2019 06:32:28 +0000 (09:32 +0300)]
win: skip winsock initialization in safe mode

uv_winsock_init calls abort() if socket operation failed, which means
all libuv-based applications are not able to start in safe mode
without network.

PR-URL: https://github.com/libuv/libuv/pull/2205
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>