| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
Implement `uv_tcp_keepalive_ex` function that extends
`uv_tcp_keepalive` to support `TCP_KEEPINTVL` and `TCP_KEEPCN`
socket options in addition to TCP_KEEPIDLE.
|
|
|
| |
The link at gnu.org is a redirect now and the docs linter breaks some times.
|
|
|
|
|
| |
The documentation is referring to an internal name -
UV_LOOP_ENABLE_IO_URING_SQPOLL - in several places. Fix this by using
the public UV_LOOP_USE_IO_URING_SQPOLL name instead.
|
|
|
|
|
|
|
|
|
|
| |
I changed the default stack size in commit 73b0c1f94 from October 2022
and although I added a versionchanged note, I didn't update the blurb
a few lines below.
It wasn't accurate before that change either though, because even with
musl libc's ~80kb thread stacks, 128 threads works out to 10 MB.
Refs: https://github.com/nodejs/node/issues/57911
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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. https://github.com/PowerShell/PowerShell/blob/4e7942135f998ab40fd3ae298b020e161a76d4ef/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: https://github.com/nodejs/node/commit/87af913b66eab78088acfd7f3b57d35e22c5f1ba
Refs: https://github.com/microsoft/terminal/issues/4954
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
Said symbols are not by default available on Windows Server 2016 but
libuv can still use them when
api-ms-win-core-processthreads-l1-1-3.dll is present.
Fixes: https://github.com/libuv/libuv/issues/4677
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
This commit documents a FreeBSD kernel issue where uv_fs_event can
receive a NULL filename and updates test-fs-event.c to skip filename
assertions on FreeBSD.
* Bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197695
Refs: https://github.com/libuv/libuv/issues/4606
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
|
|
|
| |
It was already documented but only in the uv_timer_set_repeat section.
Move it to the toplevel and flesh it out more.
Refs: https://github.com/libuv/libuv/issues/181
Refs: https://github.com/libuv/libuv/discussions/4639
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
| |
They have no return value.
|
| |
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
| |
The docs there link to GetFinalPathNameByHandleA() and CreateFileA(),
but src/win/fs.c uses GetFinalPathNameByHandleW() and CreateFileW().
|
|
|
| |
Signed-off-by: Andy Pan <i@andypan.me>
|
|
|
|
|
|
|
|
|
| |
This patch adds documentation for the introduced `uv_os_get_passwd2`,
`uv_os_get_group`, `uv_os_free_group` methods in
https://github.com/libuv/libuv/pull/3523
Fixes: https://github.com/libuv/libuv/issues/4007
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
| |
uv_udp_init() creates the UDP socket lazily but to set socket options
there must be, well, a socket to set the options on. Document how and
when that requirement is met.
Fixes: https://github.com/libuv/libuv/issues/4370
|
|
|
|
| |
Closes: https://github.com/libuv/libuv/pull/4350
Closes: https://github.com/libuv/libuv/issues/3487
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4160
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/1911
|
|
|
|
|
|
|
| |
`linkcheck` is printing the following error:
```
( guide/utilities: line 311) broken https://en.wikipedia.org/wiki/Shared_library#Shared_libraries - Anchor 'Shared_libraries' not found
```
|
| |
|
|
|
| |
add EUNATCH errno mapping
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Add two new APIs for binding and connecting to abstract UNIX sockets.
Fixes: https://github.com/libuv/libuv/issues/4028
|
|
|
|
|
|
|
|
|
|
|
| |
Document that we return UINT64_MAX if the cgroup limit is set to the
max. For cgroupv2, that happens if we encounter `max`, while cgroupv1
returns 9223372036854771712 when no limit is set (which according to
[this StackExchange discussion] is derived from LONG_MAX and
PAGE_SIZE). So make sure we also detect this case for cgroupv1.
[this StackExchange discussion]: https://unix.stackexchange.com/questions/420906/what-is-the-value-for-the-cgroups-limit-in-bytes-if-the-memory-is-not-restricte
Addresses: https://github.com/libuv/libuv/pull/3744/files#r974062912
|
| |
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/1674
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add io_uring support for several asynchronous file operations:
- read, write
- fsync, fdatasync
- stat, fstat, lstat
io_uring is used when the kernel is new enough, otherwise libuv simply
falls back to the thread pool.
Performance looks great; an 8x increase in throughput has been observed.
This work was sponsored by ISC, the Internet Systems Consortium.
Fixes: https://github.com/libuv/libuv/issues/1947
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/3928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The maximum number of times timers should run when uv_run() is called
with UV_RUN_ONCE and UV_RUN_NOWAIT is 1. Do that by conditionally
calling timers before entering the while loop when called with
UV_RUN_DEFAULT.
The reason to always run timers at the end of the while loop, instead of
at the beginning, is to help enforce the conceptual event loop model.
Which starts when entering the event provider (e.g. calling poll).
Other than only allowing timers to be processed once per uv_run()
execution, the only other noticeable change this will show is if all the
following are true:
* uv_run() is called with UV_RUN_NOWAIT or UV_RUN_ONCE.
* An event is waiting to be received when poll is called.
* Execution time between the call to uv_timer_start() and entering the
while loop is longer than the timeout.
If all these are true, then timers that would have executed before
entering the event provider will now be executed afterward.
Fixes: https://github.com/libuv/libuv/issues/3686
Co-authored-by: Momtchil Momtchev <momtchil@momtchev.com>
|
| |
|
| |
|
|
|
|
| |
Add uv_thread_getcpu() api to get the cpu number on which the calling
thread is running.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following metrics are now always recorded and available via the new
uv_metrics_info() API.
* loop_count: Number of event loop iterations.
* events: Total number of events processed by the event handler.
* events_waiting: Total number of events waiting in the event queue when
the event provider request was made.
Benchmarking has shown no noticeable impact recording these metrics.
PR-URL: https://github.com/libuv/libuv/pull/3749
|
|
|
| |
Refs: https://github.com/libuv/libuv/discussions/3809
|
| |
|