Commit Graph

5050 Commits

Author SHA1 Message Date
Supragya Raj
6530ea2ff2
drop only successfully sent packets post sendmmsg
sendmmsg returns with number of packets sent which can
be less than number of packets requested to be sent. Do
not flush entire write queue and use the returned info
to partially clear the write queue.

Refs: https://github.com/libuv/libuv/issues/3129 (fixes one issue listed)
PR-URL: https://github.com/libuv/libuv/pull/3265
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-08-24 12:20:34 +02:00
Jameson Nash
04289fa326
unix: protect fork in uv_spawn from signals
Years ago, we found that various kernels (linux, macOS) were known to
fail if they try to deliver a signal during this syscall, so we prevent
that from happening. They may have fixed those issues, but it is
generally just a bad time for signals to arrive (glibc blocks them here,
for example, including some more internal ones that it won't let us
touch here).

We try to be a bit conservative, and leave many signals unblocked which
could happen during normal execution and should terminate the process if
they do. There is a small race window after the child starts before we
clear the old handlers, if the user was to send an fake signal from
elsewhere, but that should be quite unlikely.

PR-URL: https://github.com/libuv/libuv/pull/3251
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-07-29 12:09:51 -04:00
Mohamed Edrah
84c057a357
docs: fix wrong information about scheduling
Fixes: https://github.com/libuv/libuv/issues/3252
PR-URL: https://github.com/libuv/libuv/pull/3253
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-29 12:08:53 -04:00
Jameson Nash
bd7fcf1bfc
run test named ip6_sin6_len
This appears to have been missed in the original PR.

Refs: https://github.com/libuv/libuv/pull/2492
Refs: https://github.com/libuv/libuv/issues/2655 (fixes one issue listed)
PR-URL: https://github.com/libuv/libuv/pull/3246
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-07-21 12:39:13 -04:00
Jameson Nash
574c49f07f Now working on version 1.42.1
Fixes: https://github.com/libuv/libuv/issues/3202
2021-07-20 00:48:41 -04:00
Jameson Nash
8763476155 Add SHA to ChangeLog 2021-07-19 22:44:31 -04:00
Jameson Nash
6ce14710da 2021.07.21, Version 1.42.0 (Stable)
Changes since version 1.41.0:

* doc: fix code highlighting (Darshan Sen)

* test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros (tjarlama)

* zos: build in ascii code page (Shuowang (Wayne) Zhang)

* zos: don't use nanosecond timestamp fields (Shuowang (Wayne) Zhang)

* zos: introduce zoslib (Shuowang (Wayne) Zhang)

* zos: use strnlen() from zoslib (Shuowang (Wayne) Zhang)

* zos: use nanosleep() from zoslib (Shuowang (Wayne) Zhang)

* zos: use __getargv() from zoslib to get exe path (Shuowang (Wayne)
  Zhang)

* zos: treat __rfim_utok as binary (Shuowang (Wayne) Zhang)

* zos: use execvpe() to set environ explictly (Shuowang (Wayne) Zhang)

* zos: use custom proctitle implementation (Shuowang (Wayne) Zhang)

* doc: add instructions for building on z/OS (Shuowang (Wayne) Zhang)

* linux,udp: enable full ICMP error reporting (Ondřej Surý)

* test: fix test-udp-send-unreachable (Ondřej Surý)

* include: fix typo in documentation (Tobias Nießen)

* chore: use for(;;) instead of while (Yash Ladha)

* test: remove string + int warning on udp-pummel (Juan José Arboleda)

* cmake: fix linker flags (Zhao Zhili)

* test: fix stack-use-after-scope (Zhao Zhili)

* unix: expose thread_stack_size() internally (Brandon Cheng)

* darwin: use RLIMIT_STACK for fsevents pthread (Brandon Cheng)

* darwin: abort on pthread_attr_init fail (Brandon Cheng)

* benchmark: remove unreachable code (Matvii Hodovaniuk)

* macos: fix memleaks in uv__get_cpu_speed (George Zhao)

* Make Thread Sanitizer aware of file descriptor close in uv__close()
  (Ondřej Surý)

* darwin: fix iOS compilation and functionality (Hayden)

* linux: work around copy_file_range() cephfs bug (Ben Noordhuis)

* zos: implement uv_get_constrained_memory() (Shuowang (Wayne) Zhang)

* zos: fix uv_get_free_memory() (Shuowang (Wayne) Zhang)

* zos: use CVTRLSTG to get total memory accurately (Shuowang (Wayne)
  Zhang)

* ibmi: Handle interface names longer than 10 chars (Kevin Adler)

* docs: update read-the-docs version of sphinx (Jameson Nash)

* unix: refactor uv_try_write (twosee)

* linux-core: add proper divide by zero assert (yiyuaner)

* misc: remove unnecessary _GNU_SOURCE macros (Darshan Sen)

* test: log to stdout to conform TAP spec (bbara)

* win,fs: fix C4090 warning with MSVC (SeverinLeonhardt)

* build: some systems provide dlopen() in libc (Andy Fiddaman)

* include: add EOVERFLOW status code mapping (Darshan Sen)

* unix,fs: use uv__load_relaxed and uv__store_relaxed (Darshan Sen)

* win: fix string encoding issue of uv_os_gethostname (Eagle Liang)

* unix,process: add uv__write_errno helper function (Ricky Zhou)

* Re-merge "unix,stream: clear read/write states on close/eof" (Jameson
  Nash)

* unix,core: fix errno handling in uv__getpwuid_r (Darshan Sen)

* errors: map ESOCKTNOSUPPORT errno (Ryan Liptak)

* doc: uv_read_stop always succeeds (Simon Kissane)

* inet: fix inconsistent return value of inet_ntop6 (twosee)

* darwin: fix -Wsometimes-uninitialized warning (twosee)

* stream: introduce uv_try_write2 function (twosee)

* poll,win: UV_PRIORITIZED option should not assert (twosee)

* src: DragonFlyBSD has mmsghdr struct too (David Carlier)

* cleanup,win: Remove _WIN32 guards on threadpool (James M Snell)

* freebsd: fix an incompatible pointer type warning (Darshan Sen)

* core: Correct the conditionals for {cloexec,nonblock}_ioctl (Ali
  Mohammad Pur)

* win,tcp: make uv_close work more like unix (Jameson Nash)

* doc: more accurate list of valid send_handle's (twosee)

* win,tcp: translate system errors correctly (twosee)

* unix: implement cpu_relax() on ppc64 (Ben Noordhuis)

* docs: move list of project links under PR control (Jameson Nash)

* test: wrong pointer arithmetic multiplier (Erkhes N)

* doc: switch discussion forum to github (Jameson Nash)

* idna: fix OOB read in punycode decoder (Ben Noordhuis)

* build: make sure -fvisibility=hidden is set (Santiago Gimeno)

* illumos: event ports to epoll (tjarlama)

* illumos,tty: UV_TTY_MODE_IO waits for 4 bytes (Joshua M. Clulow)

* doc: add vtjnash GPG ID (Jameson Nash)

* linux: read CPU model information on ppc (Richard Lau)

* darwin: fix uv_barrier race condition (Guilherme Íscaro)

* unix,stream: fix loop hang after uv_shutdown (Jameson Nash)

* doc,udp: note that suggested_size is 1 max-sized dgram (Ryan Liptak)

* mingw: fix building for ARM/AArch64 (Martin Storsjö)

* unix: strnlen is not available on Solaris 10 (Claes Nästén)

* sunos: restore use of event ports (Andy Fiddaman)

* sunos,cmake: use thread-safe errno (Andy Fiddaman)
2021-07-19 22:44:04 -04:00
Andy Fiddaman
7b18d0aa15
sunos,cmake: use thread-safe errno
On illumos, the global errno variable is not thread-safe by default,
requiring that the application be built with gcc's -pthread option, or
that it defines -D_REENTRANT.

This was done already for the autotools build, but not for CMake.

PR-URL: https://github.com/libuv/libuv/pull/3243
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-19 22:27:40 -04:00
Andy Fiddaman
5fe597268e
sunos: restore use of event ports
The sunos platform currently covers at least the Solaris and illumos
operating systems. Although these diverged 11 years ago they still share
some common features such as support for event ports.

illumos also has a compatibility wrapper for epoll but this is not
recommended for use over event ports. From the NOTES section of
https://illumos.org/man/5/epoll:

	The epoll facility is implemented for purposes of offering
	compatibility to and portability of Linux-borne
	applications; native applications should continue to prefer
	using event ports... In particular, use of epoll in a
	multithreaded environment is fraught with peril...

Restore the event ports code so that libuv can continue to be used
on Solaris, and to avoid the problems that come with using epoll()
on illumos. The separation of epoll into src/unix/epoll.c has been
retained.

Fixes: https://github.com/libuv/libuv/issues/3241
PR-URL: https://github.com/libuv/libuv/pull/3242
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-19 22:19:24 -04:00
Claes Nästén
8ea8f12438
unix: strnlen is not available on Solaris 10
`strnlen` was not available on Solaris 10, so provide a fallback
implementation for it.

PR-URL: https://github.com/libuv/libuv/pull/3152
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-19 13:06:51 -04:00
Martin Storsjö
f9ad802fa5
mingw: fix building for ARM/AArch64
Don't use x86 inline assembly in these cases, but fall back to
__sync_fetch_and_or, similar to _InterlockedOr8 in the MSVC case.

This corresponds to what is done in src/unix/atomic-ops.h, where
ARM/AArch64 cases end up implementing cmpxchgi with
__sync_val_compare_and_swap.

PR-URL: https://github.com/libuv/libuv/pull/3236
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-14 12:36:30 -04:00
Ryan Liptak
5c85d67bc7
doc,udp: note that suggested_size is 1 max-sized dgram
The intention here is to make working with recvmmsg more
straight-forward, since internally libuv expects buffers that are
multiples of UV__UDP_DGRAM_MAXSIZE, but previously the availability of
that value wasn't readily apparent to the caller.

Closes: https://github.com/libuv/libuv/issues/2822
Closes: https://github.com/libuv/libuv/issues/1025
Closes: https://github.com/libuv/libuv/pull/1114
PR-URL: https://github.com/libuv/libuv/pull/2986
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-13 11:20:53 -04:00
Jameson Nash
03f1a6979c
unix,stream: fix loop hang after uv_shutdown
While most users will likely typically call uv_close in their
uv_shutdown callback, some callers (notable nodejs) do not always do
so. This can result in libuv keeping the loop active, even though there
are no outstanding reqs left to handle.

This bug was added in 80f2f826bf, where
the premise of that commit appears to have simply been incorrect, as
demonstrated by the added test.

Refs: https://github.com/libuv/libuv/issues/3202
PR-URL: https://github.com/libuv/libuv/pull/3233
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-07-13 10:54:02 -04:00
Guilherme Íscaro
e49ef4f309
darwin: fix uv_barrier race condition
Prior to this patch a race condition may occur in case a thread tries
to destroy the barrier while other awaiting threads were not notified.
Since the internal mutex and condition variables are destroyed this may
cause an undefined behavior as described by the man pages.

So in order to prevent such scenarios the detroy function will not wait
until all awaiting threads are finished before proceeding.

Fixes: https://github.com/libuv/libuv/issues/3102
PR-URL: https://github.com/libuv/libuv/pull/3162
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-09 16:07:18 -04:00
Richard Lau
b12699b1ef
linux: read CPU model information on ppc
Fixes: https://github.com/libuv/libuv/issues/3217
PR-URL: https://github.com/libuv/libuv/pull/3232
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-07 16:19:47 -04:00
Jameson Nash
337dbfd968
doc: add vtjnash GPG ID
PR-URL: https://github.com/libuv/libuv/pull/3235
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2021-07-07 15:59:20 -04:00
Joshua M. Clulow
b6d51dc40e
illumos,tty: UV_TTY_MODE_IO waits for 4 bytes
uv_tty_set_mode() allows a tty device to be set to raw mode with
UV_TTY_MODE_RAW, which correctly sets MIN and TIME to appropriate
values for character input. When UV_TTY_MODE_IO is passed, on illumos
systems a compatibility implementation of cfmakeraw() is used that does
_not_ set MIN or TIME. As a result, consumers of IO mode will block
until a minimum of 4 bytes is available on the tty instead of just 1 as
is expected.

PR-URL: https://github.com/libuv/libuv/pull/3219
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-02 15:06:18 -04:00
tjarlama
caf22ddbf5
illumos: event ports to epoll
Sunos has added epoll wrappers to offer compatability for binaries
build specifically for linux (https://illumos.org/man/5/epoll). With
this, it's now possible to develop epoll as a generic interface and
share between Linux and SUNOS, similar to kqueue.

Fixes: https://github.com/libuv/libuv/issues/3008
PR-URL: https://github.com/libuv/libuv/pull/3046
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-07-02 15:00:37 -04:00
Santiago Gimeno
03d12d1a37
build: make sure -fvisibility=hidden is set
PR-URL: https://github.com/libuv/libuv/pull/3005
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-02 14:50:18 -04:00
Ben Noordhuis
b7466e31e4 idna: fix OOB read in punycode decoder
libuv was vulnerable to out-of-bounds reads in the uv__idna_toascii()
function which is used to convert strings to ASCII. This is called by
the DNS resolution function and can lead to information disclosures or
crashes.

Reported by Eric Sesterhenn in collaboration with Cure53 and ExpressVPN.

Reported-By: Eric Sesterhenn <eric.sesterhenn@x41-dsec.de>
Fixes: https://github.com/libuv/libuv/issues/3147
PR-URL: https://github.com/libuv/libuv-private/pull/1
Refs: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2021-07-02 14:07:07 -04:00
Jameson Nash
4a27d87a69 doc: switch discussion forum to github
Freenode is gone (replaced by Libera.chat), but IRC was unused anyways.

Fixes: https://github.com/libuv/libuv/issues/3157
Fixes: https://github.com/libuv/libuv/issues/3208
PR-URL: https://github.com/libuv/libuv/pull/3214
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-06-30 23:26:40 -04:00
Erkhes N
592cd40af8
test: wrong pointer arithmetic multiplier
PR-URL: https://github.com/libuv/libuv/pull/3216
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-06-30 23:24:35 -04:00
Jameson Nash
9ec6bb914f
docs: move list of project links under PR control
Copied from 
https://github.com/libuv/libuv/wiki/Projects-that-use-libuv, since the 
wiki was vulnerable to spam content.

PR-URL: https://github.com/libuv/libuv/pull/3204
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2021-06-22 13:23:59 -04:00
Darshan Sen
103dbaede3
Revert "win,fs: correct error code in uv_fs_read and uv_fs_write"
This reverts commit 9394216828.

Refs: https://github.com/libuv/libuv/pull/3180
Refs: https://github.com/libuv/libuv/pull/3205
PR-URL: https://github.com/libuv/libuv/pull/3211
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-06-21 16:03:22 -04:00
Ben Noordhuis
963ecc82d0
unix: implement cpu_relax() on ppc64
We also tell the compiler it is not allowed to reorder the PAUSE 
instruction relative to other instructions. It is a mostly theoretical 
issue, but better safe than sorry.

PR-URL: https://github.com/libuv/libuv/pull/2590
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-06-18 23:47:24 -04:00
twosee
9918a17438
win,tcp: translate system errors correctly
PR-URL: https://github.com/libuv/libuv/pull/3200
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-06-18 23:40:00 -04:00
twosee
79d836b996
doc: more accurate list of valid send_handle's
PR-URL: https://github.com/libuv/libuv/pull/3201
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-06-18 23:38:03 -04:00
Jameson Nash
99eb736b4c
win,tcp: make uv_close work more like unix
This is an attempt to fix some resource management issues on Windows. 

Win32 sockets have an issue where it sends an RST packet if there is an 
outstanding overlapped calls. We can avoid that by being certain to 
explicitly cancel our read and write requests first. 

This also removes some conditional cleanup code, since we might as well 
clean it up eagerly (like unix). Otherwise, it looks to me like these 
might cause the accept callbacks to be run after the endgame had freed 
the memory for them. 

The comment here seems mixed up between send and recv buffers. The 
default behavior on calling `closesocket` is already to do a graceful 
shutdown (see 
https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-closesocket
with default l_onoff=zero) if it is the last open handle. The expected 
behavior if there are pending reads in flight is to send an RST packet, 
notifying the client that the server connection was destroyed before 
acknowledging the EOF. 

Additionally, we need to cancel writes explicitly: we need to notify 
Win32 that it is okay to cancel these writes (so it doesn't also 
generate an RST packet on the wire).

Refs: https://github.com/libuv/libuv/pull/3035
Refs: https://github.com/nodejs/node/pull/35946
Refs: https://github.com/nodejs/node/issues/35904
Fixes: https://github.com/libuv/libuv/issues/3034
PR-URL: https://github.com/libuv/libuv/pull/3036
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-06-10 13:12:07 -04:00
Ali Mohammad Pur
6b0051d14d
core: Correct the conditionals for {cloexec,nonblock}_ioctl
These functions are declared with one set of conditionals in the
header, and defined with another set of conditionals in the c file.
This commit makes all decisions regarding `uv__{nonblock,cloexec}_ioctl`
depend on a boolean macro instead.
There's one function that expects `uv__nonblock_ioctl` to be defined,
so that bit of the function is also conditionally compiled.

PR-URL: https://github.com/libuv/libuv/pull/3163
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-06-08 13:10:35 -04:00
Darshan Sen
b201c1a0f0
freebsd: fix an incompatible pointer type warning
Fixes: https://github.com/libuv/libuv/issues/3155
PR-URL: https://github.com/libuv/libuv/pull/3188
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 11:42:09 -04:00
James M Snell
a98839d7bf
cleanup,win: Remove _WIN32 guards on threadpool
Fixes: https://github.com/libuv/libuv/issues/2980
Refs: https://github.com/nodejs/node/pull/35021
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 11:22:44 -04:00
David CARLIER
07b86b96c8
src: DragonFlyBSD has mmsghdr struct too
Still returns ENOSYS, until the send/recv functions are implemented.

PR-URL: https://github.com/libuv/libuv/pull/3040
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 11:18:22 -04:00
twosee
2ce720c6db
poll,win: UV_PRIORITIZED option should not assert
PR-URL: https://github.com/libuv/libuv/pull/3171
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 11:11:23 -04:00
Darshan Sen
9394216828
win,fs: correct error code in uv_fs_read and uv_fs_write
Just like the unix counterpart, uv_fs_read and uv_fs_write should throw 
an EBADF instead of manually throwing an EPERM when the passed fd has 
not been opened with the right access flags. 

PR-URL: https://github.com/libuv/libuv/pull/3180
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 11:07:51 -04:00
twosee
bcc4f8fdde
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>
2021-05-28 10:57:59 -04:00
twosee
6085bcef8d
darwin: fix -Wsometimes-uninitialized warning
PR-URL: https://github.com/libuv/libuv/pull/3190
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 10:52:58 -04:00
twosee
385b7960a0
inet: fix inconsistent return value of inet_ntop6
PR-URL: https://github.com/libuv/libuv/pull/3182
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-27 10:54:33 -04:00
Simon Kissane
4cf638de05 doc: uv_read_stop always succeeds
Fixes: https://github.com/libuv/libuv/issues/3041
PR-URL: https://github.com/libuv/libuv/pull/3076
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-24 16:32:41 -04:00
Ryan Liptak
46451737e6
errors: map ESOCKTNOSUPPORT errno
PR-URL: https://github.com/libuv/libuv/pull/3151
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-05-21 16:34:31 -04:00
Darshan Sen
a064166bd2
unix,core: fix errno handling in uv__getpwuid_r
Fixes: https://github.com/libuv/libuv/issues/3174
PR-URL: https://github.com/libuv/libuv/pull/3177
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-21 16:27:22 -04:00
Jameson Nash
ce15b8405e
Re-merge "unix,stream: clear read/write states on close/eof"
This reverts commit 46f36e3df1.

PR-URL: https://github.com/libuv/libuv/pull/3006
Refs: https://github.com/libuv/libuv/pull/2967
Refs: https://github.com/libuv/libuv/pull/2409
Refs: https://github.com/libuv/libuv/issues/2943
Refs: https://github.com/libuv/libuv/pull/2968
Refs: https://github.com/nodejs/node/pull/36111
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-05-21 16:20:07 -04:00
Ricky Zhou
6dbb1e2e1d
unix,process: add uv__write_errno helper function
No functional changes, but slightly more compact code.

PR-URL: https://github.com/libuv/libuv/pull/3059
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-20 10:53:12 -04:00
Jameson Nash
ac5b21a2c9
Revert "win,build: Add cmake -DSTATIC_VCRT=ON option"
This reverts commit b94934f012.

The required version of cmake (3.15) is newer than we are currently 
using in Android CI (3.10).

PR-URL: https://github.com/libuv/libuv/pull/3172
Refs: https://github.com/libuv/libuv/pull/3085
2021-05-13 23:07:14 -04:00
Eagle Liang
95f88f47f2
win: fix string encoding issue of uv_os_gethostname
Windows API gethostname(buffer, size) return unicode string in char
array. It will cause garbled code if the host name contains non ascii
characters without cast into multi byte char.

This change keep the same encoding with the implementation on
Unix/macOS platform, which is utf-8.

Requires Windows 8 / Server 2012.

Fixes: https://github.com/libuv/libuv/issues/3148
PR-URL: https://github.com/libuv/libuv/pull/3149
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-13 11:42:55 -04:00
Darshan Sen
9864053c9c
unix,fs: use uv__load_relaxed and uv__store_relaxed
This is more clear about the intended semantics with multiple threads.

PR-URL: https://github.com/libuv/libuv/pull/3124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-13 11:18:43 -04:00
Romain Roffé
b94934f012
win,build: Add cmake -DSTATIC_VCRT=ON option
PR-URL: https://github.com/libuv/libuv/pull/3085
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-13 11:06:22 -04:00
Darshan Sen
9739400d41
include: add EOVERFLOW status code mapping
Refs: https://github.com/nodejs/node/pull/38159#discussion_r610288214
PR-URL: https://github.com/libuv/libuv/pull/3145
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-13 11:01:14 -04:00
Andy Fiddaman
defed50080
build: some systems provide dlopen() in libc
libuv is packaged for OmniOS, an illumos distribution (OpenSolaris fork), and on that platform `libdl.so` is just a legacy stub library that does not need to be linked. `dlopen()` and friends are present in libc.

Changing to using `AC_SEARCH_LIBS()` instead of `AC_CHECK_LIB()` stops the unnecessary linking of libdl.

PR-URL: https://github.com/libuv/libuv/pull/3113
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-12 18:51:36 -04:00
SeverinLeonhardt
882ee25346
win,fs: fix C4090 warning with MSVC
When compiling the current code MSVC prints this warning:

    warning C4090: '=': different 'const' qualifiers

This warning was introduced with dc6fdcd where the `(char*)` cast for
the call to `wcstombs` was removed.

Re-adding this cast to silence the warning.

PR-URL: https://github.com/libuv/libuv/pull/3146
Refs: https://github.com/libuv/libuv/pull/2938
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-12 18:48:29 -04:00
bbara
0714eded19
test: log to stdout to conform TAP spec
The TAP specification [1] explicitely states:
A harness must only read TAP output from standard output and
not from standard error.

[1] https://testanything.org/tap-specification.html

PR-URL: https://github.com/libuv/libuv/pull/3153
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-05-12 18:45:47 -04:00