1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

927 Commits

Author SHA1 Message Date
Anna Henningsen
843b64faf5
win: add ENABLE_VIRTUAL_TERMINAL_INPUT raw tty mode (#4688)
Windows provides the `ENABLE_VIRTUAL_TERMINAL_INPUT` flag for TTY input
streams as a companion flag to `ENABLE_VIRTUAL_TERMINAL_PROCESSING`,
which libuv is already setting for TTY output streams.

Setting this flag lets the terminal emulator perform some of the
processing that libuv already currently does for input events,
but most notably enables receiving control sequences that are
otherwise entirely unavailable, e.g. for bracketed paste
(which the Node.js readline implementation added basic support for
in https://github.com/nodejs/node/commit/87af913b66eab78088acfd).

libuv currently already provides translations for key events to
control sequences, i.e. what this mode is intended to provide,
but libuv does not and cannot translate all such events.
Since the control sequences differ from the ones that Windows
has chosen to standardize on, and applications may not be expecting
this change, this is opt-in for now (but ideally will be the default
behavior starting in libuv v2.x, should that ever happen).

Another downside of this change is that not all shells reset
this mode when an application exits. For example, when running a
Node.js program with this flag enabled inside of PowerShell in
Windows terminal, if the application exits while in raw TTY input mode,
neither the shell nor the terminal emulator reset this flag, rendering
the input stream unusable.

While there's general awareness of the problem that console state is
global state rather than per-process (same as on UNIX platforms),
it seems that applications like PowerShell aren't expecting to need to
unset this flag on the input stream, only its output counterpart
(e.g. 4e7942135f/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs (L1156)).

Hence, `uv_tty_reset_mode()` is extended to reset the terminal
to its original state if the new mode is being used.

Refs: 87af913b66
Refs: https://github.com/microsoft/terminal/issues/4954
2025-02-21 23:34:53 +01:00
Ben Noordhuis
85b526f56a
unix,win: accept NAN/INFINITY as file timestamps (#4702)
Extend uv_fs_utime, uv_fs_futime and uv_fs_lutime to accept NAN and
INFINITY, with NAN meaning "don't touch the timestamp" and INFINITY
meaning "set to the current timestamp."

Ugly, but it avoids having to add uv_fs_utime2, etc.

UV_FS_UTIME_NOW and UV_FS_UTIME_OMIT constants have been added to make
it more palatable.

Fixes: https://github.com/libuv/libuv/issues/4665
2025-02-21 23:08:15 +01:00
Santiago Gimeno
0f31978c30
Now working on version 1.50.1 2025-01-15 19:11:00 +01:00
Santiago Gimeno
8fb9cb9194 2025.01.15, Version 1.50.0 (Stable)
Changes since version 1.49.2:

* ci: run macOS and iOS tests also on macOS 14 (Saúl Ibarra Corretgé)

* unix,win: map ENOEXEC errno (Saúl Ibarra Corretgé)

* test: skip multicast join test on ENOEXEC (Saúl Ibarra Corretgé)

* ci: make sure the macOS firewall is disabled (Saúl Ibarra Corretgé)

* darwin,test: squelch EBUSY error on multicast join (Saúl Ibarra
  Corretgé)

* build: update minimum cmake to 3.10 (Ben Noordhuis)

* kqueue: use EVFILT_USER for async if available (Jameson Nash)

* unix,win: fix off-by-one in uv_wtf8_to_utf16() (Ben Noordhuis)

* doc: add scala-native-loop to LINKS.md (Julian A Avar C)

* unix: fix build breakage on haiku, openbsd, etc (Jeffrey H. Johnson)

* kqueue: lower overhead in uv__io_check_fd (Andy Pan)

* doc: move cjihrig back to active maintainers (cjihrig)

* build(deps): bump actions/checkout from 3 to 4 (dependabot[bot])

* unix,pipe: fix handling null buffer in uv_pipe_get{sock,peer}name
  (Saúl Ibarra Corretgé)

* unix,win: harmonize buffer checking (Saúl Ibarra Corretgé)

* unix,win: add support for detached threads (Juan José Arboleda)

* src: add uv_thread_set/getname() methods (Santiago Gimeno)

* build: fix qemu builds (Ben Noordhuis)

* win: drop support for windows 8 (Ben Noordhuis)

* linux: fix uv_cpu_info() arm cpu model detection (Ben Noordhuis)

* linux: always use io_uring for epoll batching (Ben Noordhuis)

* doc: clarify repeating timer behavior more (Ben Noordhuis)

* unix,win: handle nbufs=0 in uv_udp_try_send (Ben Noordhuis)

* win: use GetQueuedCompletionStatusEx directly (Saúl Ibarra Corretgé)

* win: enable uv_thread_{get,set}name on MinGW (Saúl Ibarra Corretgé)

* win: drop support for the legacy MinGW (Saúl Ibarra Corretgé)

* win,fs: get (most) fstat when no permission (Jameson Nash)

* win: plug uv_fs_event_start memory leak (amcgoogan)

* test: address FreeBSD kernel bug causing NULL path in fsevents (Juan
  José Arboleda)

* unix: refactor udp sendmsg code (Ben Noordhuis)

* unix,win: add uv_udp_try_send2 (Ben Noordhuis)

* test: fix flaky flaky udp_mmsg test (Juan José Arboleda)

* build: enable fdsan in Android (Juan José Arboleda)

* test: fix udp-multicast-join for FreeBSD (Juan José Arboleda)

* win: fix leak processing fs event (Saúl Ibarra Corretgé)

* src: set a default thread name for workers (Rafael Gonzaga)

* misc: implement uv_getrusage_thread (Juan José Arboleda)
2025-01-15 19:05:29 +01:00
Juan José
be8eec8c5a
misc: implement uv_getrusage_thread (#4666)
Refs: https://github.com/libuv/libuv/issues/3119

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
2025-01-14 14:50:26 +01:00
Ben Noordhuis
e8969bff6c unix,win: add uv_udp_try_send2
Add a version of uv_udp_try_send that can send multiple datagrams.

Uses sendmmsg(2) on platforms that support it (Linux, FreeBSD, macOS),
falls back to a regular sendmsg(2) loop elsewhere.

This work was sponsored by ISC, the Internet Systems Consortium.
2024-12-13 21:52:59 +01:00
Ben Noordhuis
7b4cf04a91 unix: refactor udp sendmsg code
Shuffle around and DRY the sendmsg logic in preparation for
uv_udp_try_send2(). NFC barring bugs.

This work was sponsored by ISC, the Internet Systems Consortium.
2024-12-13 21:52:59 +01:00
Saúl Ibarra Corretgé
16e6e84dcc
win: drop support for the legacy MinGW (#4645)
The OG MinGW has been dead for years, MinGW-w64 has taken its place.
2024-12-12 15:59:30 +01:00
Ben Noordhuis
14644080c8
win: drop support for windows 8 (#4624)
Fixes: https://github.com/libuv/libuv/issues/3889
2024-11-28 22:02:41 +01:00
Santiago Gimeno
61c966cf0b
src: add uv_thread_set/getname() methods (#4599)
`uv_thread_setname()` sets the name of the current thread. Different
platforms define different limits on the max number of characters
a thread name can be: Linux, IBMi (16), macOS (64), Windows (32767),
and NetBSD (32), etc. `uv_thread_setname()` will truncate it in case
`name` is larger than the limit of the platform.

`uv_thread_getname()` gets the name of the thread specified by `tid`.
The thread name is copied into the buffer pointed to by `name`. The
`size` parameter specifies the size of the buffer pointed to by `name`.
The buffer should be large enough to hold the name of the thread plus
the trailing NUL, or it will be truncated to fit.
2024-11-27 12:52:18 +01:00
Juan José
556a0f1f0f
unix,win: add support for detached threads (#4621)
This commit introduces the `uv_thread_detach` for thread detaching,
allowing threads to be detached state on both UNIX and Windows platforms.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
2024-11-26 08:44:38 -05:00
Saúl Ibarra Corretgé
64f4502b9b unix,win: map ENOEXEC errno 2024-10-22 10:26:32 +02:00
Santiago Gimeno
94e467ad93
Now working on version 1.49.3 2024-10-18 21:08:15 +02:00
Santiago Gimeno
e1095c7a43 2024.10.18, Version 1.49.2 (Stable)
Changes since version 1.49.1:

* win,fs: remove trailing slash in junctions (Hüseyin Açacak)

* Revert "linux: eliminate a read on eventfd per wakeup" (Ben Noordhuis)

* win: Fix linked list logic in getaddrinfo (Thad House)

* win: fix compilation against Windows 24H2 SDK (Thad House)

* win: remap ERROR_NOACCESS and ERROR_BUFFER_OVERFLOW (Jameson Nash)

* win,fs: match trailing slash presence in junctions to user input
  (Jameson Nash)
2024-10-18 21:02:38 +02:00
Santiago Gimeno
be0b00a80d
Now working on version 1.49.2 2024-10-11 09:21:05 +02:00
Santiago Gimeno
8be336f4ee 2024.10.11, Version 1.49.1 (Stable)
Changes since version 1.49.0:

* build: add darwin-syscalls.h to release tarball (Ben Noordhuis)

* linux: use IORING_SETUP_NO_SQARRAY when available (Ben Noordhuis)

* linux: use IORING_OP_FTRUNCATE when available (Ben Noordhuis)

* win: fix pNtQueryDirectoryFile check (Rialbat)

* win: fix WriteFile() error translation (Santiago Gimeno)

* win,fs: uv_fs_rmdir() to return ENOENT on file (Santiago Gimeno)

* win,pipe: ipc code does not support async read (Jameson Nash)

* netbsd: fix build (Adam)

* win,fs: fix bug in fs__readdir (Hüseyin Açacak)

* unix: workaround gcc bug on armv7 (Santiago Gimeno)

* unix: work around arm-linux-gnueabihf-gcc bug (Ben Noordhuis)

* unix: fix uv_tcp_keepalive in smartOS (Santiago Gimeno)

* unix: fix uv_getrusage ru_maxrss on solaris (Poul T Lomholt)
2024-10-11 09:13:10 +02:00
Santiago Gimeno
5467ec969a
Now working on version 1.49.1 2024-09-25 10:37:04 +02:00
Santiago Gimeno
d2e56a5e8d 2024.09.25, Version 1.49.0 (Stable)
Changes since version 1.48.0:

* test: fix -Wpointer-to-int-cast on 32 bits systems (Ben Noordhuis)

* build: add alias for libuv to CMakeLists.txt (Anthony Alayo)

* linux: create io_uring sqpoll ring lazily (Ben Noordhuis)

* misc: run sample CI when code changes (Jameson Nash)

* linux: fix uv_available_parallelism using cgroup (Thomas Walter)

* doc: fix tty example segfault (hiiizxf)

* udp,unix: fix sendmsg use-after-free (Geddy)

* cygwin: implement uv_resident_set_memory (Farzin Monsef)

* win: almost fix race detecting ESRCH in uv_kill (Santiago Gimeno)

* test: disable env var test under win32+asan (Ben Noordhuis)

* unix,fs: fix realpath calls that use the system allocator (Saúl Ibarra
  Corretgé)

* sunos: sync tcp keep-alive with other unices (Andy Pan)

* linux: fix /proc/self/stat executable name parsing (Farzin Monsef)

* test,ci: fix [AM]San, disable ASLR (Ben Noordhuis)

* win: remove _alloca usage (Ben Noordhuis)

* unix: reinstate preadv/pwritev fallback code (Ben Noordhuis)

* linux: don't delay EPOLL_CTL_DEL operations (Ben Noordhuis)

* doc: fix typos in ChangeLog (tgolang)

* unix,win: error on zero delay tcp keepalive (Saúl Ibarra Corretgé)

* win: simplify uv_once implementation (Saúl Ibarra Corretgé)

* doc: correct udp socket options documentation (Ben Noordhuis)

* linux: don't use sendmmsg() for single datagrams (Ben Noordhuis)

* unix: fix fd leaks in SCM_RIGHTS error path (Ben Noordhuis)

* win: robustify uv_os_getenv() error checking (Ben Noordhuis)

* test: use newer ASSERT_MEM_EQ macro (Ben Noordhuis)

* unix: de-duplicate conditions for using kqueue (Brad King)

* darwin: simplify uv_hrtime (Saúl Ibarra Corretgé)

* mailmap: update saghul's main email address (Saúl Ibarra Corretgé)

* win: remove no longer needed define (Saúl Ibarra Corretgé)

* doc: fix some typos (josedelinux)

* linux,darwin: make `uv_fs_copyfile` behaves like `cp -r` (Juan José
  Arboleda)

* dragonfly: disable SO_REUSEPORT for UDP socket bindings (Andy Pan)

* test: remove the obsolete HAVE_KQUEUE macro (Andy Pan)

* unix: use the presence of SOCK_* instead of OS macros for socketpair
  (Andy Pan)

* bsd: support pipe2() on *BSD (Andy Pan)

* unix: support SO_REUSEPORT with load balancing for TCP (Andy Pan)

* doc: add entries for extended getpw (Juan José Arboleda)

* test: fix the flaky test-tcp-reuseport (Andy Pan)

* aix,ibmi: fix compilation errors in fs_copyfile (Jeffrey H. Johnson)

* unix: support SO_REUSEPORT with load balancing for UDP (Andy Pan)

* tcpkeepalive: distinguish OS versions and use proper time units (Andy
  Pan)

* win: map ERROR_BAD_EXE_FORMAT to UV_EFTYPE (Hüseyin Açacak)

* doc: add instruction how to install with Conan (Uilian Ries)

* unix,win: remove unused req parameter from macros (Viacheslav
  Muravyev)

* build: fix android ci build (Ben Noordhuis)

* unix,win: export wtf8 functions properly (Ben Noordhuis)

* hurd: add includes and macro prerequisites (Olivier Valentin)

* hurd: stub uv_thread_setpriority() (Olivier Valentin)

* ci: use macOS 12 for macOS and iOS builds (Saúl Ibarra Corretgé)

* darwin: fix crash on iOS(arm64) (郑苏波 (Super Zheng))

* Create dependabot.yml for updating github-actions (Jameson Nash)

* doc: correct names of Win32 APIs in fs.rst (zeertzjq)

* ci: bump upload and download-artifact versions (dependabot[bot])

* ci: bump actions/setup-python from 4 to 5 (dependabot[bot])

* ci: bump KyleMayes/install-llvm-action from 1 to 2 (dependabot[bot])

* win,error: remap ERROR_NO_DATA to EAGAIN (Jameson Nash)

* test: handle zero-length udp datagram (Ben Noordhuis)

* misc: remove splay trees macros (Viacheslav Muravyev)

* test,openbsd: remove superfluous ifdef guard (Ben Noordhuis)

* win,fs: use posix delete semantics, if supported (Ian Butterworth)

* win: fix env var in uv_os_homedir and uv_os_tmpdir (Hüseyin Açacak)

* fsevents: detect watched directory removal (Santiago Gimeno)

* ci: bump actions/checkout to 4 (dependabot[bot])

* linux: eliminate a read on eventfd per wakeup (Andy Pan)

* test: pipe_overlong_path handle ENAMETOOLONG (Abdirahim Musse)

* win,fs: use the new Windows fast stat API (Hüseyin Açacak)

* win,pipe: fix race with concurrent readers (Jameson Nash)

* win,signal: fix data race dispatching SIGWINCH (Jameson Nash)

* build: ubsan fixes (Matheus Izvekov)

* linux: disable SQPOLL io_uring by default (Santiago Gimeno)

* win: fix fs.c ubsan failure (Matheus Izvekov)

* test: rmdir can return `EEXIST` or `ENOTEMPTY` (Richard Lau)

* test: check for `UV_CHANGE` or `UV_RENAME` event (Richard Lau)

* unix,fs: silence -Wunused-result warning (Santiago Gimeno)

* linux: support abstract unix socket autobinding (Ben Noordhuis)

* kqueue: use EVFILT_USER for async if available (Andy Pan)

* win: remove deprecated GetVersionExW call (Shelley Vohr)

* doc: document uv_loop_option (握猫猫)

* doc: fix the `uv_*_set_data` series of functions (握猫猫)

* doc: properly label enumerations and types (握猫猫)

* doc: document specific macOS fs_event behavior (Santiago Gimeno)

* win,pipe: restore fallback handling for blocking pipes (Jameson Nash)

* unix,win: remove unused rb-tree macro parameters (Viacheslav Muravyev)

* win: compute parallelism from process cpu affinity (Ben Noordhuis)

* win: use NtQueryInformationProcess in uv_os_getppid (Zuohui Yang)

* win,pipe: fix missing assignment to success (Jameson Nash)

* win: fix uv_available_parallelism on win32 (Ben Noordhuis)

* win,pipe: fix another missing assignment to success (Jameson Nash)

* kqueue: disallow ill-suited file descriptor kinds (Andy Pan)

* unix: restore tty attributes on handle close (Ben Noordhuis)

* test: delete test with invalid assumption (Ben Noordhuis)

* dragonflybsd: fix compilation failure (Jeffrey H. Johnson)

* test: run android tests on ci (Edigleysson Silva (Edy))

* darwin: add udp mmsg support (Raihaan Shouhell)

* unix: work around arm-linux-gnueabihf-gcc bug (Ben Noordhuis)

* unix: expand uv_available_parallelism() to support more platforms
  (Ondřej Surý)

* doc: add known issue in armv7 (Santiago Gimeno)
2024-09-25 10:17:20 +02:00
Viacheslav Muravyev
b5eb41d882
unix,win: remove unused rb-tree macro parameters (#4518) 2024-08-25 22:54:09 +02:00
Santiago Gimeno
e78e29c231
linux: disable SQPOLL io_uring by default (#4492)
The SQPOLL io_uring instance wasn't providing consistent behaviour to
users depending on kernel versions, load shape, ... creating issues
difficult to track and fix. Don't use this ring by default but allow
enabling it by calling `uv_loop_configure()` with
`UV_LOOP_ENABLE_IO_URING_SQPOLL`.
2024-08-06 22:10:13 +02:00
Viacheslav Muravyev
e4d47c5357
misc: remove splay trees macros (#4469) 2024-07-29 16:45:12 -04:00
Ben Noordhuis
2780b87d56
unix,win: export wtf8 functions properly (#4437)
Mark them UV_EXTERN so they are visible on Windows.

Fixes: https://github.com/libuv/libuv/issues/4436
2024-07-12 10:22:26 +02:00
Andy Pan
ba24986f8d
unix: support SO_REUSEPORT with load balancing for UDP (#4419)
Signed-off-by: Andy Pan <i@andypan.me>
2024-06-20 17:17:17 +02:00
Andy Pan
d2d92b74a8
unix: support SO_REUSEPORT with load balancing for TCP 2024-05-21 13:36:49 +02:00
Saúl Ibarra Corretgé
abc9767034
win: simplify uv_once implementation
* win: simplify uv_once implementation

InitOnceExecuteOnce is available in Windows >= Vista.

Ref: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceexecuteonce
2024-03-25 11:57:52 +01:00
Santiago Gimeno
08a1e7fd23
Now working on version 1.48.1
Fixes: https://github.com/libuv/libuv/issues/4248
2024-02-07 22:44:52 +01:00
Santiago Gimeno
e9f29cb984 2024.02.07, Version 1.48.0 (Stable)
Changes since version 1.47.0:

* misc: remove deprecated stalebot file (Jameson Nash)

* build: disable windows asan buildbot (Ben Noordhuis)

* test: don't run tcp_writealot under msan (Ben Noordhuis)

* build,win: remove extraneous -lshell32 (Ben Noordhuis)

* unix: ignore ifaddrs with NULL ifa_addr (Stephen Gallagher)

* unix,win: utility for setting priority for thread (Hao Hu)

* pipe: add back error handling to connect / bind (Jameson Nash)

* test: check if ipv6 link-local traffic is routable (Ben Noordhuis)

* win: remove check for UV_PIPE_NO_TRUNCATE (Jameson Nash)

* linux: disable io_uring on hppa below kernel 6.1.51 (matoro)

* unix,win: fix read past end of pipe name buffer (Ben Noordhuis)

* unix: unbreak macOS < 10.14 (Sergey Fedorov)

* aix: disable ipv6 link local (Abdirahim Musse)

* doc: move cjihrig to emeriti (cjihrig)

* unix: correct pwritev conditional (Bo Anderson)

* test_fs.c: Fix issue on 32-bit systems using btrfs (Stephen Gallagher)

* misc: ignore libuv-release-tool files (Jameson Nash)

* win: honor NoDefaultCurrentDirectoryInExePath env var (Ardi Nugraha)

* idna: fix compilation warning (Saúl Ibarra Corretgé)

* linux: remove HAVE_IFADDRS_H macro (Ben Noordhuis)

* test: skip tcp-write-in-a-row on IBM i (Abdirahim Musse)

* build,win: work around missing uuid.dll on MinGW (Anton Bachin)

* win: stop using deprecated names (Matheus Izvekov)

* unix,win: fix busy loop with zero timeout timers (Matheus Izvekov)

* aix,ibmi: use uv_interface_addresses instead of getifaddrs (Abdirahim
  Musse)

* linux: fix bind/connect for abstract sockets (Santiago Gimeno)

* win: replace c99 comments with c89 comments (Trevor Flynn)

* build: add .cache clangd folder to .gitignore (Juan José Arboleda)

* unix: support full TCP keep-alive on Solaris (Andy Pan)

* freebsd: fix F_KINFO file path handling (David Carlier)

* linux: retry fs op if unsupported by io_uring (Santiago Gimeno)

* freebsd: fix build on non-intel archs (David Carlier)

* unix: optimize uv__tcp_keepalive cpp directives (Andy Pan)

* linux: disable io_uring on ppc64 and ppc64le (Brad King)

* doc: add very basic Security Policy document (Santiago Gimeno)

* build: re-enable msvc-asan job on CI (Jameson Nash)

* win/spawn: optionally run executable paths with no file extension
  (Brad King)

* win: fix ESRCH implementation (Jameson Nash)

* unix,win: reset the timer queue on stop (Santiago Gimeno)

* fix: always zero-terminate idna output (Ben Noordhuis)

* fix: reject zero-length idna inputs (Ben Noordhuis)

* test: empty strings are not valid IDNA (Santiago Gimeno)

* Merge pull request from GHSA-f74f-cvh7-c6q6 (Ben Noordhuis)
2024-02-07 20:20:07 +00:00
Brad King
3f7191e5c2
win/spawn: optionally run executable paths with no file extension (#4292)
Add a process options flag to enable the optional behavior. Most users
are likely recommended to set this flag by default, but it was deemed
potentially breaking to set it by default in libuv.

Co-authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2024-02-05 11:04:05 -05:00
Trevor Flynn
64bd28f5ba
win: replace c99 comments with c89 comments (#4270) 2024-01-05 10:34:33 +01:00
Matheus Izvekov
51a22f60d6
unix,win: fix busy loop with zero timeout timers (#4250)
Calling `uv_timer_start(h, cb, 0, 0)` from a timer callback resulted in
the timer running immediately because it was inserted at the front of
the timer heap.

If the callback did that every time, libuv would effectively busy-loop
in `uv__run_timers()` and never make forward progress.

Work around that by collecting all expired timers into a queue and only
running their callback afterwards.

Fixes: https://github.com/libuv/libuv/issues/4245
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2023-12-22 12:40:50 +01:00
Hao Hu
e135dfe183
unix,win: utility for setting priority for thread (#4075)
Add uv_thread_setpriority for setting priority for threads created by
uv_thread_create. Add uv_thread_getpriority for getting thread priority.

For Linux by default, if the scheduling policy is SCHED_OTHER and the
priority is 0, we need to set the nice value.

Fixes: https://github.com/libuv/libuv/issues/4051
2023-11-14 11:30:46 +01:00
Jameson Nash
815693f715 Now working on version 1.47.1
Fixes: https://github.com/libuv/libuv/issues/4186
2023-11-06 13:24:46 -05:00
Jameson Nash
be6b81a352 2023.11.06, Version 1.47.0 (Stable)
Changes since version 1.46.0:

* test: fix license blurb (Ben Noordhuis)

* linux: fix harmless warn_unused_result warning (Shuduo Sang)

* darwin: fix build warnings (小明)

* linux: don't use io_uring on pre-5.10.186 kernels (Ben Noordhuis)

* fs: fix WTF-8 decoding issue (Jameson Nash)

* test: enable disabled tcp_connect6_error_fault (Ben Noordhuis)

* test: enable disabled fs_link (Ben Noordhuis)

* test: enable disabled spawn_same_stdout_stderr (Ben Noordhuis)

* linux: handle UNAME26 personality (Ben Noordhuis)

* build: move cmake_minimum_required version to 3.9 (Keith Winstein)

* unix: set ipv6 scope id for link-local addresses (Ben Noordhuis)

* unix: match kqueue and epoll code (Trevor Norris)

* win,spawn: allow `%PATH%` to be unset (Kyle Edwards)

* doc: switch to Furo, a more modern Sphinx theme (Saúl Ibarra Corretgé)

* darwin: make TCP_KEEPINTVL and TCP_KEEPCNT available (小明)

* win,fs: avoid winapi macro redefinition (Brad King)

* linux: add missing riscv syscall numbers (michalbiesek)

* doc: fix broken "Shared library" Wikipedia link (Alois Klink)

* unix: get mainline kernel version in Ubuntu (Santiago Gimeno)

* unix: get mainline kernel version in Debian (Ben Noordhuis)

* build: fix qemu install in CI-unix workflow (Santiago Gimeno)

* unix: disable io_uring close on selected kernels (Santiago Gimeno)

* test: skip tests when ipv6 is not available (Santiago Gimeno)

* ibmi: implement ifaddrs, getifaddrs, freeifaddrs (Abdirahim Musse)

* unix: reset signal counters after fork (SmorkalovG)

* win,process: avoid assert after spawning Store app (Jameson Nash)

* unix: remove pread/preadv conditionals (Ben Noordhuis)

* unix: remove pwrite/pwritev conditionals (Ben Noordhuis)

* darwin: remove workaround for data corruption bug (Ben Noordhuis)

* src: default to stream=stderr in handle printer (Ben Noordhuis)

* test: switch to new-style ASSERT_EQ macros (Pleuvens)

* zos: correctly get cpu model in uv_cpu_info() (jolai)

* test: fix get_passwd2 on IBM i (Abdirahim Musse)

* unix: don't malloc on sync uv_fs_read (Ben Noordhuis)

* freebsd: get fs event path with fcntl(F_KINFO) (David Carlier)

* test: switch from ASSERT_* to ASSERT_PTR_* (Pleuvens)

* darwin: workaround apple pthread_cond_wait bug (Julien Roncaglia)

* doc: uv_close should be called after exit callback (Pleuvens)

* test: 192.0.2.0/24 is the actual -TEST-NET-1 (prubel)

* unix: add back preadv/pwritev fallback (Ben Noordhuis)

* unix: rename variable for consistency (Ben Noordhuis)

* unix: merge read/write code into single functions (Ben Noordhuis)

* doc: filename arg to uv_fs_event_cb can be NULL (Ben Noordhuis)

* build,win: we need to link against shell32.lib (Per Allansson)

* unix: no preadv/pwritev workaround if not needed (Jeffrey H. Johnson)

* build: add CI for Windows ARM64 (build only) (Per Allansson)

* linux: disable io_uring on 32 bits arm systems (Ben Noordhuis)

* build: run sanitizers on macos ci (Ben Noordhuis)

* misc: export WTF8 conversion utilities (Jameson Nash)

* build: fix libuv.a file name for cmake (Jameson Nash)

* build: add windows ubsan and clang ci (Matheus Izvekov)

* win: improve accuracy of ProductName between arch (Christian Heimlich)
2023-11-06 13:17:17 -05:00
Jameson Nash
f388908593
misc: export WTF8 conversion utilities (#4021)
As promised in #2970, this attempts to migrate code to a common set of
utilities in a common place in the code and use them everywhere. This
also exports the functionality, since the Windows API with
WideCharToMultiByte is fairly verbose relative to what libuv and
libuv's clients typically need, so it is useful not to require clients
to reimplement this conversion logic unnecessarily (and because Windows
is not 64-bit ready here, but this implementation is.)
2023-10-28 21:04:57 -04:00
Santiago Gimeno
c5644368b5
Now working on version 1.46.1
Fixes: https://github.com/libuv/libuv/issues/4060
2023-06-30 22:58:52 +02:00
Santiago Gimeno
f0bb7e40f0 2023.06.30, Version 1.46.0 (Stable)
Changes since version 1.45.0:

* Add SHA to ChangeLog (Santiago Gimeno)

* misc: update readthedocs config (Jameson Nash)

* test: remove erroneous RETURN_SKIP (Ben Noordhuis)

* android: disable io_uring support (Ben Noordhuis)

* linux: add some more iouring backed fs ops (Santiago Gimeno)

* build: add autoconf option for disable-maintainer-mode (Jameson Nash)

* fs: use WTF-8 on Windows (Stefan Karpinski)

* unix,win: replace QUEUE with struct uv__queue (Ben Noordhuis)

* linux: fs_read to use io_uring if iovcnt > IOV_MAX (Santiago Gimeno)

* ios: fix uv_getrusage() ru_maxrss calculation (Ben Noordhuis)

* include: update outdated code comment (Ben Noordhuis)

* linux: support abstract unix sockets (Ben Noordhuis)

* unix,win: add UV_PIPE_NO_TRUNCATE flag (Ben Noordhuis)

* unix: add loongarch support (liuxiang88)

* doc: add DPS8M to LINKS.md (Jeffrey H. Johnson)

* include: add EUNATCH errno mapping (Abdirahim Musse)

* src: don't run timers if loop is stopped/unref'd (Trevor Norris)

* win: fix -Wpointer-to-int-cast warning (Ben Noordhuis)

* test,win: fix -Wunused-variable warning (Ben Noordhuis)

* test,win: fix -Wformat warning (Ben Noordhuis)

* linux: work around io_uring IORING_OP_CLOSE bug (Ben Noordhuis)

* win: remove unused functions (Ben Noordhuis)

* bench: add bench to check uv_loop_alive (Trevor Norris)

* test: add uv_cancel test for threadpool (Trevor Norris)

* unix: skip prohibited syscalls on tvOS and watchOS (小明)

* unix,fs: make no_pwritev access thread-safe (Santiago Gimeno)

* unix: fix build for lower versions of Android (小明)
2023-06-30 18:31:51 +00:00
Abdirahim Musse
6a9e4293d8
include: add EUNATCH errno mapping (#4047)
add EUNATCH errno mapping
2023-06-16 09:27:39 -04:00
liuxiang88
7ada448d18
unix: add loongarch support (#4054)
Signed-off-by: liuxiang <liuxiang@loongson.cn>
2023-06-16 10:25:25 +02:00
Ben Noordhuis
2f1614b128
unix,win: add UV_PIPE_NO_TRUNCATE flag (#4040)
Libuv's default behavior is to truncate long Unix socket paths. The flag
tells it to return an error instead.

Fixes: https://github.com/libuv/libuv/issues/4036
2023-06-06 17:08:36 +02:00
Ben Noordhuis
b9b6db052b
linux: support abstract unix sockets (#4030)
Add two new APIs for binding and connecting to abstract UNIX sockets.

Fixes: https://github.com/libuv/libuv/issues/4028
2023-06-04 22:43:14 +02:00
Ben Noordhuis
e8ec610f28
include: update outdated code comment (#4037)
I believe it's fair to say at this point that these functions are not
going to be removed in v0.12. They are still deprecated though.
2023-06-04 22:41:58 +02:00
Ben Noordhuis
1b01b786c0
unix,win: replace QUEUE with struct uv__queue (#4022)
Recent versions of gcc have started emitting warnings about the liberal
type casting inside the QUEUE macros. Although the warnings are false
positives, let's use them as the impetus to switch to a type-safer and
arguably cleaner approach.

Fixes: https://github.com/libuv/libuv/issues/4019
2023-05-25 00:04:30 +02:00
Santiago Gimeno
a4649f5078 Now working on version 1.45.1
Fixes: https://github.com/libuv/libuv/issues/3887
2023-05-19 13:37:42 +02:00
Santiago Gimeno
b9789a452f 2023.05.19, Version 1.45.0 (Stable)
Changes since version 1.44.2:

* win: remove stdint-msvc2008.h (Ben Noordhuis)

* android: remove pthread-fixes.c (Ben Noordhuis)

* build: enable MSVC_RUNTIME_LIBRARY setting (自发对称破缺)

* unix: switch to c11 atomics (Ben Noordhuis)

* unix: don't accept() connections in a loop (Ben Noordhuis)

* win: fix off-by-1 buffer overrun in uv_exepath() (Ben Noordhuis)

* build: switch ci from macos-10.15 to macos-11 (Ben Noordhuis)

* win: fix thread race in uv_cwd() and uv_chdir() (Ben Noordhuis)

* unix,win: remove UV_HANDLE_SHUTTING flag (Santiago Gimeno)

* win: support Windows 11 in uv_os_uname() (Luan Devecchi)

* unix: fix uv_getrusage() ru_maxrss reporting (Ben Noordhuis)

* doc: add note about offset -1 in uv_fs_read/write (Steven
  Schveighoffer)

* test: fix musl libc.a dlerror() test expectation (Ben Noordhuis)

* kqueue: DRY file descriptor deletion logic (Ben Noordhuis)

* linux: teach uv_get_constrained_memory() cgroupsv2 (Ben Noordhuis)

* build: upgrade qemu-user-static package (Ben Noordhuis)

* linux: move epoll.c back into linux-core.c (Ben Noordhuis)

* unix: remove pre-macos 10.8 compatibility hack (Ben Noordhuis)

* unix,win: fix memory leak in uv_fs_scandir() (Ben Noordhuis)

* build: restore qemu download logic (Ben Noordhuis)

* win: fix uv__pipe_accept memory leak (number201724)

* doc: update LINKS.md (Daniel)

* unix: simplify atomic op in uv_tty_reset_mode() (Ben Noordhuis)

* build: add LIBUV_BUILD_SHARED cmake option (Christian Clason)

* linux: remove unused or obsolete syscall wrappers (Ben Noordhuis)

* linux: merge files back into single file (Ben Noordhuis)

* stream: process more than one write req per loop tick (ywave620)

* unix,win: give thread pool threads an 8 MB stack (Ben Noordhuis)

* build: add MemorySanitizer (MSAN) support (Ben Noordhuis)

* doc: add uv_poll_cb status==UV_EBADF note (jensbjorgensen)

* build: support AddressSanitizer on MSVC (Jameson Nash)

* win,pipe: improve method of obtaining pid for ipc (number201724)

* thread: add support for affinity (daomingq)

* include: map ENODATA error code (Ben Noordhuis)

* build: remove bashism from autogen.sh (Santiago Gimeno)

* win,tcp,udp: remove "active streams" optimization (Saúl Ibarra
  Corretgé)

* win: drop code checking for Windows XP / Server 2k3 (Saúl Ibarra
  Corretgé)

* unix,win: fix 'sprintf' is deprecated warning (twosee)

* doc: mention close_cb can be NULL (Qix)

* win: optimize udp receive performance (ywave620)

* win: fix an incompatible types warning (twosee)

* doc: document 0 return value for free/total memory (Ben Noordhuis)

* darwin: use hw.cpufrequency again for frequency info (Jameson Nash)

* win,test: change format of TEST_PIPENAME's (Santiago Gimeno)

* win,pipe: fixes in uv_pipe_connect() (Santiago Gimeno)

* misc: fix return value of memory functions (theanarkh)

* src: add new metrics APIs (Trevor Norris)

* thread: add uv_thread_getcpu() (daomingq)

* build: don't use ifaddrs.h on solaris 10 (Edward Humes)

* unix,win: add uv_get_available_memory() (Tim Besard)

* test: fix -Wunused-but-set-variable warnings (Ben Noordhuis)

* doc: bump min supported linux and freebsd versions (Ben Noordhuis)

* Add Socket Runtime to the LINKS.md (Sergey Rubanov)

* unix: drop kfreebsd support (Ben Noordhuis)

* win: fix fstat for pipes and character files (Stefan Stojanovic)

* win: fix -Wunused-variable warning (Ben Noordhuis)

* win: fix -Wunused-function warning (Ben Noordhuis)

* build: drop qemu-alpha from ci matrix (Ben Noordhuis)

* win: move child_stdio_buffer out of uv_process_t (Santiago Gimeno)

* test: fix some unreachable code warnings (Santiago Gimeno)

* linux: simplify uv_uptime() (Ben Noordhuis)

* test: unflake fs_event_watch_dir test (Ben Noordhuis)

* darwin: remove unused fsevents symbol lookups (Ben Noordhuis)

* build: add define guard around UV_EXTERN (Zvicii)

* build: add UndefinedBehaviorSanitizer support (Ben Noordhuis)

* build: enable platform_output test on qemu (Ben Noordhuis)

* linux: handle cpu hotplugging in uv_cpu_info() (Ben Noordhuis)

* build: remove unnecessary policy setting (dundargoc)

* docs: add vcpkg instruction step (Jack·Boos·Yu)

* win,fs: fix readlink errno for a non-symlink file (Darshan Sen)

* misc: extend getpw to take uid as an argument (Jameson Nash)

* unix,win: use static_assert when available (Ben Noordhuis)

* docs: delete code Makefile (Jameson Nash)

* docs: add CI for docs PRs (Jameson Nash)

* docs: update Sphinx version on RTD (Jameson Nash)

* doc: clean up license file (Ben Noordhuis)

* test: fix some warnings when compiling tests (panran)

* build,win: add mingw-w64 CI configuration (Jameson Nash)

* build: add CI for distcheck (Jameson Nash)

* unix: remove busy loop from uv_async_send (Jameson Nash)

* doc: document uv_fs_cb type (Tamás Bálint Misius)

* build: Improve build by cmake for Cygwin (erw7)

* build: add libuv:: namespace to libuvConfig.cmake (AJ Heller)

* test: fix ThreadSanitizer thread leak warning (Ben Noordhuis)

* test: fix ThreadSanitizer data race warning (Ben Noordhuis)

* test: fix ThreadSanitizer data race warning (Ben Noordhuis)

* test: fix ThreadSanitizer data race warning (Ben Noordhuis)

* test: cond-skip fork_threadpool_queue_work_simple (Ben Noordhuis)

* test: cond-skip signal_multiple_loops (Ben Noordhuis)

* test: cond-skip tcp_writealot (Ben Noordhuis)

* build: promote tsan ci to must-pass (Ben Noordhuis)

* build: add CI for OpenBSD and FreeBSD (James McCoy)

* build,test: fix distcheck errors (Jameson Nash)

* test: remove bad tty window size assumption (Ben Noordhuis)

* darwin,process: feed kevent the signal to reap children (Jameson Nash)

* unix: abort on clock_gettime() error (Ben Noordhuis)

* test: remove timing-sensitive check (Ben Noordhuis)

* unix: DRY and fix tcp bind error path (Jameson Nash)

* macos: fix fsevents thread race conditions (Ben Noordhuis)

* win: fix leak in uv_chdir (Trevor Norris)

* test: make valgrind happy (Trevor Norris)

* barrier: wait for prior out before next in (Jameson Nash)

* test: fix visual studio 2015 build error (Ben Noordhuis)

* linux: fix ceph copy error truncating readonly files (Bruno Passeri)

* test: silence more valgrind warnings (Trevor Norris)

* doc: add entries to LINKS.md (Trevor Norris)

* win,unix: change execution order of timers (Trevor Norris)

* doc: add trevnorris to maintainers (Trevor Norris)

* linux: remove epoll_pwait() emulation code path (Ben Noordhuis)

* linux: replace unsafe macro with inline function (Ben Noordhuis)

* linux: remove arm oabi support (Ben Noordhuis)

* unix,sunos: SO_REUSEPORT not valid on all sockets (Stacey Marshall)

* doc: consistent single backquote in misc.rst (Jason Zhang)

* src: switch to use C11 atomics where available (Trevor Norris)

* test: don't use static buffer for formatting (Ben Noordhuis)

* linux: introduce io_uring support (Ben Noordhuis)

* linux: fix academic valgrind warning (Ben Noordhuis)

* test: disable signal test under ASan and MSan (Ben Noordhuis)

* linux: add IORING_OP_OPENAT support (Ben Noordhuis)

* linux: add IORING_OP_CLOSE support (Ben Noordhuis)

* linux: remove bug workaround for obsolete kernels (Ben Noordhuis)

* doc: update active maintainers list (Ben Noordhuis)

* test: add ASSERT_OK (Trevor Norris)

* src: fix events/events_waiting metrics counter (Trevor Norris)

* unix,win: add uv_clock_gettime() (Ben Noordhuis)

* build: remove freebsd and openbsd buildbots (Ben Noordhuis)

* win: fix race condition in uv__init_console() (sivadeilra)

* linux: fix logic bug in sqe ring space check (Ben Noordhuis)

* linux: use io_uring to batch epoll_ctl calls (Ben Noordhuis)

* macos: update minimum supported version (Santiago Gimeno)

* docs: fix some typos (cui fliter)

* unix: use memcpy() instead of type punning (Ben Noordhuis)

* test: add additional assert (Mohammed Keyvanzadeh)

* build: export compile_commands.json (Lewis Russell)

* win,process: write minidumps when sending SIGQUIT (Elliot Saba)

* unix: constrained_memory should return UINT64_MAX (Tim Besard)

* unix: handle CQ overflow in iou ring (Santiago Gimeno)

* unix: remove clang compiler warning pragmas (Ben Noordhuis)

* win: fix mingw build (gengjiawen)

* test: fix -Wbool-compare compiler warning (Ben Noordhuis)

* win: define MiniDumpWithAvxXStateContext always (Santiago Gimeno)

* freebsd: hard-code UV_ENODATA definition (Santiago Gimeno)

* linux: work around EOWNERDEAD io_uring kernel bug (Ben Noordhuis)

* linux: fix WRITEV with lots of bufs using io_uring (Santiago Gimeno)
2023-05-19 13:37:42 +02:00
Santiago Gimeno
6f94701467
freebsd: hard-code UV_ENODATA definition (#3999)
`FreeBSD` defines `ENODATA` in /usr/include/c++/v1/errno.h which is only visible
if C++ is the compilation unit. This can cause interop issues when
integrating libuv build with C on a C++ project. Avoid this issue by
directly defining with the value defined in the file previously
mentioned.
2023-05-16 20:43:30 +02:00
Elliot Saba
748d894e82
win,process: write minidumps when sending SIGQUIT (#3840)
This commit adds the ability to dump core when sending the `SIGQUIT`
signal on Windows. The change reads in the current registry setting for
local dumps, and attempts to write out to that location before killing
the process. See [collecting-user-mode-dumps] for registry and pathing
details. This behavior mimics that of the dumps created by the typical
Windows Error Reporting mechanism.

[collecting-user-mode-dumps]: https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps
2023-05-12 14:28:35 -04:00
cui fliter
3990fcad62
docs: fix some typos (#3984) 2023-05-12 14:12:01 -04:00
Ben Noordhuis
c8a1e6132b
unix,win: add uv_clock_gettime() (#3971)
Fixes: https://github.com/libuv/libuv/issues/1674
2023-04-27 22:13:46 +02:00
Jameson Nash
964f79f7c8
barrier: wait for prior out before next in (#3905)
This code would previously get confused between rounds of the barrier
being called and a thread might incorrectly get stuck (deadlock) if the
next round started before that thread had exited the current round.

Avoid that by not starting the next round in++ before out-- has reached
zero indicating that all threads have left the prior round.

And fix it that on Windows by replacing the implementation with the one
from unix. There are some awkward platform-specific redirection here
with an extra malloc that is not needed on Win32, but that will be fixed
in libuv v2.

Fixes: https://github.com/libuv/libuv/issue/3872
2023-03-06 17:57:25 -05:00
Jameson Nash
2f110a50df
misc: extend getpw to take uid as an argument (#3523)
File system operations may return uid and gid values, which we may want
to pretty-print. We already have the code for getting information for
the current user, so just need to add a parameter to make it exposed for
every user. We expose information about groups in a similar manner also.
2023-01-17 21:51:28 -06:00