Commit Graph

5615 Commits

Author SHA1 Message Date
Cody Tapscott
588ea9b913
win: readlink support for IO_REPARSE_TAG_LX_SYMLINK (#4994)
This adds support for "Linux"-style Windows symbolic links, reparse tag
0xA000001D (IO_REPARSE_TAG_LX_SYMLINK).
2026-01-16 10:38:18 +01:00
Ben Noordhuis
3908e54252
test: make pty test work under asan (#4996)
AddressSanitizer was right to complain about the test because it was
passing an uninitialized `struct winsize` to openpty().
2026-01-15 21:39:23 +01:00
Ben Noordhuis
d67f9d2fba
test: fix -Wstringop-overread warning (#4993)
Check the length before doing the compare like we do a few lines below,
not the other way around. It's a false positive because the length is
capped well below the maximum object size but it's an easy fix.

Fixes the following warning:

    test/test-poll-oob.c:94:19: warning: ‘strncmp’ specified bound
    [18446744071562067968, 18446744073709551615] exceeds maximum
    object size 9223372036854775807 [-Wstringop-overread]
2026-01-13 14:35:19 +01:00
Ben Noordhuis
f420c2bd57
test: fix -Wuninitialized-const-pointer warning (#4990)
Zero the struct. The compiler is not aware it's not actually used.
2026-01-07 23:24:28 +01:00
Ben Noordhuis
91ae02a63d
unix,win: add f_frsize field to uv_statfs_t (#4984)
Fixes: https://github.com/libuv/libuv/issues/4983
2026-01-01 22:33:44 +01:00
Ben Noordhuis
8b870dab3d
doc: remove hp-ux from supported platforms list (#4985)
As of January 1, 2026, HP-UX is well and truly dead. Remove it.
2026-01-01 21:34:36 +01:00
Oblivionsage
3e9ae1bca0
unix: remove handle from queue on uv_spawn() error (#4980)
If uv_spawn() fails after uv__handle_init() has been called, the handle
remains in loop->handle_queue. This causes use-after-free if the handle
is stack-allocated or freed, and a subsequent loop operation like
uv_walk() accesses it.

This follows the same pattern as uv_tcp_init_ex() which explicitly
removes the handle from the queue on error.
2025-12-26 16:53:42 +01:00
Ben Noordhuis
309b28bdbe
doc: add handle and request usage guidelines (#4978)
Refs: https://github.com/libuv/libuv/discussions/4977
2025-12-21 19:00:09 +01:00
Santiago Gimeno
9c876b2f3b
test: run more fs tests using io_uring too (#4970)
Fix `threadpool_cancel_fs_iouring` so it takes `UV_FS_FTRUNCATE` into
account.
2025-12-20 22:30:42 +01:00
dependabot[bot]
ec7ec98b70
build(deps): bump actions/upload-artifact from 5 to 6 (#4975)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-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-12-15 07:35:23 -05:00
dependabot[bot]
5c91d49561
build(deps): bump actions/download-artifact from 6 to 7 (#4974)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  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-12-15 07:34:09 -05:00
chemodax
ada5131840 win: Optimize file/directory delete.
Use GetFileInformationByHandleEx(FileBasicInfo) instead of GetFileInformationByHandle() because it's cheaper -- one syscall, instead of two [1]

[1]: https://blog.axiorema.com/engineering/hidden-cost-getfileinformationbyhandle/
2025-12-12 08:46:10 +01:00
Ben Noordhuis
ac591507f3
ci: add macos-15-intel to matrix (#4968)
And fix a stupid typo that made GHA skip running the tests 🤦
2025-12-10 20:43:08 +01:00
Kartik Puri
504887a339
doc: add example usage for uv_sleep (#4955) 2025-12-10 07:23:39 +01:00
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