Commit Graph

4328 Commits

Author SHA1 Message Date
Ben Noordhuis
087c461ee9 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>
2019-06-20 12:06:31 +02:00
Ben Noordhuis
6e18112127 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>
2019-06-20 12:04:16 +02:00
Ben Noordhuis
53f4772115 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>
2019-06-20 12:01:30 +02:00
Anna Henningsen
ee24ce900e
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>
2019-06-10 15:17:21 +02:00
Vlad A
9a10058e72 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>
2019-06-07 10:59:44 +02:00
Ben Noordhuis
d89bd156cf 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>
2019-06-07 09:59:00 +02:00
Leorize
abe4f3d58d 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>
2019-06-07 09:57:06 +02:00
ken-cunningham-webuse
ffad651b9d 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>
2019-06-07 09:52:04 +02:00
Ben Noordhuis
9a41731949 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>
2019-06-07 09:38:28 +02:00
cjihrig
4a4c9a688f
Now working on version 1.29.2
Fixes: https://github.com/libuv/libuv/issues/2306
2019-05-21 09:47:22 -04:00
cjihrig
3f5c1f339d
Add SHA to ChangeLog 2019-05-21 09:44:45 -04:00
cjihrig
d16e6094e1
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)
2019-05-21 09:44:45 -04:00
Ben Noordhuis
d7f0055b80
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>
2019-05-21 09:02:15 -04:00
cjihrig
fddcd14825
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>
2019-05-21 08:50:33 -04:00
cjihrig
693b534f2c
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>
2019-05-20 14:07:46 -04:00
cjihrig
2169a53cd2
Now working on 1.29.1
Fixes: https://github.com/libuv/libuv/issues/2293
2019-05-15 13:16:23 -04:00
cjihrig
77db62edac
Add SHA to ChangeLog 2019-05-15 13:14:17 -04:00
cjihrig
43957efd92
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)
2019-05-15 13:14:17 -04:00
Ben Noordhuis
2138dd2f08
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>
2019-05-15 12:19:46 -04:00
Ben Noordhuis
9063c27f92
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>
2019-05-15 12:18:57 -04:00
Kelvin Jin
c4e9657d59
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>
2019-05-15 11:35:05 -04:00
ken-cunningham-webuse
6602fca820
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>
2019-05-15 11:28:19 -04:00
Kyle Edwards
69c85fa88e
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>
2019-05-13 22:11:50 -04:00
George Zhao
a833f921b8
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>
2019-05-13 21:42:52 -04:00
FX Coudert
68173cc802
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>
2019-05-13 16:06:29 -04:00
Michele Caini
557b04cdce
doc: add missing uv_fs_type entries
PR-URL: https://github.com/libuv/libuv/pull/2280
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-05-13 16:00:58 -04:00
Anna Henningsen
6c760b6207 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>
2019-05-06 15:02:01 +02:00
Tobias Nießen
620be96fc4
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>
2019-04-26 20:10:27 +02:00
Santiago Gimeno
8b87533863
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>
2019-04-26 20:04:16 +02:00
Ben Noordhuis
a74e54bc8f 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>
2019-04-23 21:47:21 +02:00
Ben Noordhuis
cb30144f52 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>
2019-04-23 21:43:23 +02:00
Ben Noordhuis
3a1be72532 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>
2019-04-23 11:49:37 +02:00
Oscar Waddell
1c2dc9c8d1 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>
2019-04-23 11:28:10 +02:00
Ben Noordhuis
03e389eb43 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>
2019-04-23 10:46:56 +02:00
Ben Noordhuis
ab5859129b 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>
2019-04-23 10:45:28 +02:00
Ben Noordhuis
37042a5bca 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>
2019-04-22 16:22:36 +02:00
Leon Huang
87a116c4d0 doc: update the cmake testing instruction
PR-URL: https://github.com/libuv/libuv/pull/2253
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-04-22 16:20:20 +02:00
Xu Meng
16fe9a8602 ibmi: read memory and CPU usage info
PR-URL: https://github.com/libuv/libuv/pull/2261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-04-22 16:16:28 +02:00
cjihrig
2e443b12bd
Now working on 1.28.1
Fixes: https://github.com/libuv/libuv/issues/2228
2019-04-15 11:21:31 -04:00
cjihrig
500c929772
Add SHA to ChangeLog 2019-04-15 11:19:27 -04:00
cjihrig
7bf8fabfa9
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)
2019-04-15 11:19:26 -04:00
cjihrig
2a9d626b4c
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>
2019-04-11 14:10:14 -04:00
cjihrig
2e090c8f2c
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>
2019-04-11 14:08:17 -04:00
Kamil Rytarowski
38bb0f5f5f
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>
2019-04-11 12:36:55 -04:00
Yury Selivanov
89a027d862
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>
2019-04-11 11:04:43 -04:00
Ben Noordhuis
280f7b2496
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>
2019-04-11 10:50:19 -04:00
Jameson Nash
0da05ce652
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>
2019-04-11 10:17:51 -04:00
zlargon
9521339c2e
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>
2019-04-11 10:00:06 -04:00
Ben Noordhuis
a40a5e897d
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>
2019-04-11 09:39:37 -04:00
Milad Farazmand
fd67cd538c
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>
2019-04-11 09:31:29 -04:00