Commit Graph

5651 Commits

Author SHA1 Message Date
Ben Noordhuis
4eefcbeb5c
ci: update macos runner images (#4967)
Add macos-15 runners. Remove the deprecated macos-13 runners.

Fixes: https://github.com/libuv/libuv/issues/4965
Refs: https://github.com/actions/runner-images/issues/10924
2025-12-09 17:36:57 +01:00
Bart Louwers
3c1e7013b3
Update OS X reference to macOS in README (#4964) 2025-12-08 19:02:08 -05:00
Santiago Gimeno
fd89e63f2f linux: fix uv_fs_ftruncate io_uring implementation (#4963 2/2)
The `offset` field should be assigned to ithe `io_uring_sqe.off` field.
2025-12-08 10:31:45 +01:00
Santiago Gimeno
e522b27da3 test: add macros to run fs tests with io_uring (#4963 1/2)
Added `TEST_FS_DECLARE`, `TEST_FS_ENTRY` and `TEST_FS_IMPL` so we can
run test-fs.c tests both using the threadpool and io_uring
implementations.
2025-12-08 10:31:45 +01:00
Ambuj Vashistha
9640bc6510
unix,win: fix leak in uv_os_environ error path (#4960) 2025-12-06 22:04:49 +01:00
Ben Noordhuis
d7dda9edfe
win: handle sshfs-win quirk in uv_fs_readdir() (#4953)
The initial FindFirstFile can fail with ERROR_FILE_NOT_FOUND, meaning
no matches (read: empty directory), which leaves dir_handle set to
INVALID_HANDLE_VALUE. Not an actual error, it just means no results.

I can't get FindFirstFile to work like that on regular file systems
but it's been reported that it does under sshfs-win and the MSDN
documentation clearly states it's possible. Handle it.

Fixes: https://github.com/libuv/libuv/issues/4952
2025-12-02 16:37:17 +01:00
Ayush Kumar
bf44c3fdcc
unix: support nanosecond resolution in uv__fs_to_timespec (#4951)
Remove the microsecond truncation in uv__fs_to_timespec() function to enable
full nanosecond resolution support. The utimensat() system call already
supports nanosecond precision, so the artificial truncation to microseconds
is no longer necessary.

This allows file modification and access times to be set with full nanosecond
precision instead of being limited to microsecond resolution.

Fixes the TODO comment about removing the microsecond resolution limit.
2025-12-02 08:42:44 +01:00
Ben Noordhuis
8fc70344df
win: fix race in uv_fs_event_start() (#4948)
Fetch file metadata by handle instead of by path, otherwise there is a
race window between fetching and acting on said metadata where another
process can replace the file with another one.

There is still a potential race when upgrading the short path to a long
path but that that one is intrinsic. It's not something libuv can solve
except by refraining from calling GetLongPathName.

Fixes: https://github.com/libuv/libuv/issues/4568
2025-11-29 20:21:40 +01:00
dependabot[bot]
8e024629fe build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 23:25:44 +01:00
Andy Pan
f6e19be743 win: rename minimal_windows10_version1709() for libuv's convention
---------

Signed-off-by: Andy Pan <i@andypan.me>
2025-11-22 15:43:50 +01:00
Gang Zhuo
01250432eb
doc: fix documentation for uv_utf16_to_wtf8() function (#4935)
When `wtf8_ptr` is NULL, the length will be stored in `wtf8_len_ptr` (not in `wtf8_ptr`).

Fixes: https://github.com/libuv/libuv/issues/4934
2025-11-18 20:45:29 +01:00
Ben Noordhuis
b33162dd0b
unix: fix use of uninitialized variable (#4924)
The `flags` argument to `uv__udp_recvmsg_errqueue` was not initialized
in all code paths. Shuffle code around to make the control flow more
obvious (at the cost of a less legible diff.)

Also fixes an unused label warning when building on systems that aren't
Linux.

Introduced last month in commit 80a5e3ba0, "linux: add MSG_ERRQUEUE
ipv4/ipv6 udp support".
2025-11-06 22:34:44 +01:00
dependabot[bot]
12d1ed1380 build(deps): bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 09:51:07 +01:00
dependabot[bot]
300fc32263
build(deps): bump actions/download-artifact from 5 to 6 (#4914)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 07:56:06 -04:00
Christian Guinard
a944c422cc
darwin: better heuristic for available memory (#4908)
Fixes: https://github.com/libuv/libuv/issues/3897
2025-10-15 08:35:42 +02:00
Ben Noordhuis
f3ce527ea9
ibmi: add stub function to satisfy linker (#4905)
Add a stub function for no-ahafs builds. src/unix/core.c won't actually
call uv__ahafs_event but the linker still needs to see a symbol.

Like commit 87943b03 but for IBM i instead of AIX this time.
2025-10-07 23:08:33 +02:00
Juan José
80a5e3ba01
linux: add MSG_ERRQUEUE ipv4/ipv6 udp support (#4902)
Fixes: https://github.com/libuv/libuv/issues/4447
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: theanarkh <theratliter@gmail.com>
2025-10-06 16:45:58 +02:00
Ben Noordhuis
87943b03b3
aix: add stub function to satisfy linker (#4903)
Add a stub function for no-ahafs builds. src/unix/core.c won't actually
call uv__ahafs_event but the linker still needs to see a symbol.
2025-10-05 18:40:12 +02:00
Juan José
ee67f3db88
unix,win: implement uv_udp_open_ex (#4896)
Fixes: https://github.com/libuv/libuv/issues/4551

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-10-04 09:43:07 +02:00
Juan José
50f281c044
test: make thread_priority robust against system default nice levels (#4901)
The test previously assumed a default nice value of 0, but this can vary
depending on PAM configuration, /etc/security/limits.conf, or other environment
settings.

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

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-10-03 11:32:58 -04:00
green-br
74079a8e47
unix: add neoverse-v2 cpu identifier (#4897) 2025-10-01 19:18:20 +02:00
Ben Noordhuis
553bb9858f
aix: fix nullptr check in uv__skip_lines (#4892)
Fixes: https://github.com/libuv/libuv/issues/4891
2025-09-25 20:21:54 +02:00
Jameson Nash
cfdce92fa5
unix: fix uv__signal_loop_cleanup call in init (#4876)
While unlikely that this fails (since it is implemented to call
`abort()` instead of actually return an error code, we would
theoretically leak this state. The process state init doesn't actually
have a cleanup, and just awkwardly relies on uv_signal_close being
unnecessary (which is likely true though).
2025-09-25 11:02:44 -04:00
dependabot[bot]
392590a738
build(deps): bump actions/setup-python from 5 to 6 (#4884) 2025-09-25 11:02:28 -04:00
moe li
271d173b6e
unix,win: look up UV_THREADPOOL_SIZE with uv_os_getenv (#4888)
Use libuv's OS-independent implementation to look up UV_THREADPOOL_SIZE.

Fixes: https://github.com/libuv/libuv/issues/4887
2025-09-14 18:14:44 +02:00
m0cg
47611f7855
doc: correct uv_cancel return value (#4886)
There is a minor error about the return value of uv_cancel
for tasks that are already executing. All other parts of the
documentation correctly states that uv_cancel will fail.
2025-09-11 23:39:16 +02:00
Ben Noordhuis
2e86f6b635
win: fix path size calculation (#4878)
_snwprintf_s takes its length argument in characters, not bytes.

Does not appear to be a security issue because the paths are not under
an attacker's control unless the system has been compromised beyond
salvation: requires a combination of being able to set the name of the
executable and/or changing %LOCALAPPDATA% or a registry key.

Refs: https://github.com/libuv/libuv/security/advisories/GHSA-jjrx-vr7q-7732
2025-09-03 08:37:31 +02:00
Jameson Nash
c6330d9655
build: add -Werror when testing -Wflags (#4831)
Without -Werror=unknown-warning-option, these conditional argument
additions would not work as intended on clang.
2025-08-27 13:37:04 -04:00
Juan José
64dd229a5b
unix: remove UV__SIGNAL_EVENT dispatch from uv__io_cb (#4871)
uv__signal_event() is invoked directly from uv__io_poll(), so the
UV__SIGNAL_EVENT case in uv__io_cb() is never reached.

Refs: https://github.com/libuv/libuv/pull/4854#discussion_r2246110177
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-08-25 22:39:46 +02:00
Santiago Gimeno
9ba8078272
netbsd: fix thread affinity compilation error (#4787)
Fixes: https://github.com/libuv/libuv/issues/4785
2025-08-25 16:22:15 +02:00
Ben Noordhuis
36d6a17c9a
unix: fix build on the bsds (#4870)
Fix build breakage introduced a couple of days ago in commit 3813460d
("unix: replace uv__io_t callback pointer with enum"). Mea culpa.

Fixes: https://github.com/libuv/libuv/issues/4864
2025-08-25 16:21:37 +02:00
Ben Noordhuis
12fbd34475
win: shrink fd hash table from 2592k to 162k (#4869)
The static initial table reserved space for MxN elements but only used
every Nth element. Removing the excess elements shrinks the table 16x.

I added search/insertion/deletion time logging while here to ensure no
performance regressions.

Fixes: https://github.com/libuv/libuv/issues/4823
2025-08-24 20:22:54 +02:00
Ben Noordhuis
a9c8da7726
test,win: fix -Wattributes warnings (#4868)
Fixes: https://github.com/libuv/libuv/issues/4865
2025-08-24 20:22:23 +02:00
Ben Noordhuis
9a8d9c66f3
test,win: fix -Wcast-function-type warnings (#4867) 2025-08-24 20:22:04 +02:00
Ben Noordhuis
385896c388
test,win: fix -Wunused-function warnings (#4866) 2025-08-24 20:21:46 +02:00
Ben Noordhuis
3813460d57
unix: replace uv__io_t callback pointer with enum (#4854)
Rationale for changing it to an enum:

- frees up some bits that can be used for other things
- is potentially faster (direct vs. indirect call)
- is potentially more secure (makes UAF or overruns harder to exploit,
  no arbitrary function pointer to clobber)

Fixes: https://github.com/libuv/libuv/issues/4842
2025-08-23 20:41:01 +02:00
Savas Sahin
3b1ac021e3
win: fix compiler warnings (#4860) 2025-08-20 21:17:02 +02:00
Anton Kirilov
3d9d7c7ef6
unix: improve uv__cpu_relax() on arm (#4863)
The AArch64 YIELD instruction affects processors that support
symmetric multithreading, while on other implementations (which
are the majority on the market) it is equivalent to NOP, thus
failing to achieve the desired delay effect inside uv__async_spin().
Instead, use the ISB instruction, following one of Arm's
recommendations [1].

[1] https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm

Signed-off-by: Anton Kirilov <anton.kirilov@arm.com>
2025-08-20 21:15:37 +02:00
dependabot[bot]
07c8a3c4ca build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-19 11:32:36 +02:00
Emily
8aad181416
test: use relative paths for pipes and unix sockets (#4850)
This fixes the test suite in environments where `/tmp` is not writable
or does not allow the use of Unix sockets, and matches the use of
relative paths elsewhere in the tests.
2025-08-16 22:08:55 +02:00
Ben Noordhuis
b161b1f475
doc: remove nodeuv from LINKS.md (#4859)
The original repository was deleted and the URL is now owned by someone
else.

Refs: https://hackerone.com/bugs?report_id=3295855
2025-08-13 20:56:44 +02:00
dependabot[bot]
173b763334 build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 15:56:07 +02:00
Lawrence Stubbs
056e180e11
doc: update link, repo name change to c-asio (#4855) 2025-08-03 22:46:00 +02:00
Ben Noordhuis
2e7c07f4d1
linux: handle cgroups cpu.max with limit < period (#4853)
This apparently manifests when one passes `--cpu=.5` to docker because
then /sys/fs/cgroup/cpu.max looks like `50000 100000`, and 50000 divided
by 100000 is zero when using integer math.

Return 1 in that case, indicating there is at least one CPU available.
Returning 0 makes no sense because there is always at least one CPU
available, otherwise the program wouldn't be running.

Fixes: https://github.com/nodejs/node/issues/59200
2025-07-31 11:54:57 +02:00
Lawrence Stubbs
e70d5e8a12
doc: add binding C framework uv_coroutine to LINKS.md 2025-07-31 11:29:46 +02:00
Ben Noordhuis
33b192c845
unix: fix udp sendmmsg fallback path (#4849)
Fix a logic bug in the fallback code for platforms that don't have a
sendmmsg-like system call. It only sent at most one packet, even when
there were more available, and that was observable through a failing
test on such systems.

Fixes: https://github.com/libuv/libuv/issues/4848
2025-07-29 01:06:40 +02:00
Sean Dewar
aee30bd8d0 doc: fix return value for uv_pipe_connect2
It was incorrectly documented as returning void since its addition, but it
returns int.
2025-07-28 11:24:47 +02:00
Keno Fischer
6cf854c11b
win: work around wine bug in uv_fs_{unlink,rmdir} (#4833)
Wine has a bug (https://bugs.winehq.org/show_bug.cgi?id=50771) where
FILE_WRITE_ATTRIBUTES will cause CreateFile to fail if the file is
read-only. The recommended work around is to instead use
FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE, which we do as of #4318.
However, we were still using FILE_WRITE_ATTRIBUTES to create the
initial handle, despite this no longer being required, except for
the fallback path. As a result, libuv is still broken under wine,
even on master. Fix this by removing the `FILE_WRITE_ATTRIBUTES`
from the initial CreateFile call and re-opening the handle in the
fallback path if necessary. Note that we still have the same issue
in fs_chmod and I've requested some guidance from wine on what
to do about this, but this should at least fix unlink.

Refs: https://github.com/JuliaLang/julia/issues/58980
2025-07-24 21:15:39 +02:00
Ben Noordhuis
7484ab251f
win: use ProcessPrng (#4836)
Refs: https://github.com/libuv/libuv/pull/2762#issuecomment-3065018271
2025-07-16 20:18:29 +02:00
wisemanny
917c1ad1d1
win: add arm64 machine type to uv_os_uname (#4840)
Fixes: https://github.com/libuv/libuv/issues/4838
Co-authored-by: maxim <maxim@wiselydone.com>
2025-07-16 19:55:26 +02:00