History log of /libuv/src/unix/core.c (Results 1 – 25 of 299)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 7c3abfbf 10-Oct-2024 Poul T Lomholt

unix: fix uv_getrusage ru_maxrss on solaris (#4572)


# 670e75ee 04-Oct-2024 Adam

netbsd: fix build


# e1a54652 19-Sep-2024 Ondřej Surý

unix: expand uv_available_parallelism() to support more platforms


# a49f264d 11-Sep-2024 Ben Noordhuis

unix: restore tty attributes on handle close (#4399)

Libuv stores the `struct termios` for use inside uv_tty_reset_mode().

Node.js uses said function to restore the tty to its origi

unix: restore tty attributes on handle close (#4399)

Libuv stores the `struct termios` for use inside uv_tty_reset_mode().

Node.js uses said function to restore the tty to its original mode
on SIGINT or SIGTERM, when there is no opportunity to shut down the
process normally.

Track uv_tty_t handle closing, otherwise we might be trying to use a
stale termios.

The current solution is not ideal because there can be multiple handles
that refer to the same tty/pty and, for various reasons, we can't really
determine when we close the last handle. The last handle may not even be
inside the current process.

Still, all things considered, it's probably (hopefully!) an improvement
over the status quo.

Refs: https://github.com/libuv/libuv/issues/4398

show more ...


# 27134547 18-Feb-2024 Andy Pan

kqueue: use EVFILT_USER for async if available

Establishes a user event for kqueue to eliminate the overhead
of the pipe and the system call read(2) per wakeup event.

---------

kqueue: use EVFILT_USER for async if available

Establishes a user event for kqueue to eliminate the overhead
of the pipe and the system call read(2) per wakeup event.

---------

Signed-off-by: Andy Pan <i@andypan.me>

Co-authored-by: Jameson Nash <vtjnash@gmail.com>

show more ...


# ae6e1467 18-Jul-2024 Olivier Valentin

hurd: stub uv_thread_setpriority()


# fedfa989 03-Jun-2024 Andy Pan

tcpkeepalive: distinguish OS versions and use proper time units

---------

Signed-off-by: Andy Pan <i@andypan.me>


# ba24986f 20-Jun-2024 Andy Pan

unix: support SO_REUSEPORT with load balancing for UDP (#4419)

Signed-off-by: Andy Pan <i@andypan.me>


# 6b56200c 28-Feb-2024 Thomas Walter <31201229+waltoss@users.noreply.github.com>

linux: fix uv_available_parallelism using cgroup (#4278)

uv_available_parallelism does not handle container cpu limit
set by systems like Docker or Kubernetes. This patch fixes
this

linux: fix uv_available_parallelism using cgroup (#4278)

uv_available_parallelism does not handle container cpu limit
set by systems like Docker or Kubernetes. This patch fixes
this limitation by comparing the amount of available cpus
returned by syscall with the quota of cpus available defined
in the cgroup.

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

show more ...


# e135dfe1 14-Nov-2023 Hao Hu <33607772+hhu8@users.noreply.github.com>

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 th

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

show more ...


# 7b43d70b 26-Jun-2023 小明 <7737673+caobug@users.noreply.github.com>

unix: fix build for lower versions of Android (#4046)

Available since Android N (API level 24): getgrgid_r, preadv, pwritev

Refs: https://cs.android.com/android/platform/superprojec

unix: fix build for lower versions of Android (#4046)

Available since Android N (API level 24): getgrgid_r, preadv, pwritev

Refs: https://cs.android.com/android/platform/superproject/+/master:bionic/docs/status.md

show more ...


# 24d1d080 14-Jun-2023 Trevor Norris

src: don't run timers if loop is stopped/unref'd (#4048)

The initial run of timers shouldn't happen if uv_stop() has been run
before uv_run() was called, and for backwards compatibility

src: don't run timers if loop is stopped/unref'd (#4048)

The initial run of timers shouldn't happen if uv_stop() has been run
before uv_run() was called, and for backwards compatibility they also
shouldn't run if they have been unref'd before calling uv_run().

show more ...


# 65c1402e 25-May-2023 Ben Noordhuis

ios: fix uv_getrusage() ru_maxrss calculation (#4027)

Apple's documentation claims ru_maxrss is reported in kilobytes but the
XNU source code suggests the actual unit is bytes, like macO

ios: fix uv_getrusage() ru_maxrss calculation (#4027)

Apple's documentation claims ru_maxrss is reported in kilobytes but the
XNU source code suggests the actual unit is bytes, like macOS.

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

show more ...


# 1b01b786 24-May-2023 Ben Noordhuis

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

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

show more ...


# c8a1e613 27-Apr-2023 Ben Noordhuis

unix,win: add uv_clock_gettime() (#3971)

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


# 2f33980a 12-Apr-2023 Trevor Norris

src: switch to use C11 atomics where available (#3950)

Switch all code in unix/ to use C11 atomics directly.

Change uv_library_shutdown() to use an exchange instead of load/store.

src: switch to use C11 atomics where available (#3950)

Switch all code in unix/ to use C11 atomics directly.

Change uv_library_shutdown() to use an exchange instead of load/store.

Unfortunately MSVC only started supporting C11 atomics in VS2022 version
17.5 Preview 2 as experimental. So resort to using the Interlocked API.

Ref: https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-2022-version-17-5-preview-2/
Fixes: https://github.com/libuv/libuv/issues/3948

show more ...


# 66009549 20-Mar-2023 Trevor Norris

win,unix: change execution order of timers (#3927)

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

win,unix: change execution order of timers (#3927)

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>

show more ...


# 42cc412c 01-Feb-2023 Jameson Nash

darwin,process: feed kevent the signal to reap children (#3893)

Since we are emulating this event, but are not using the pending_queue,
we need to make sure it is accounted for properly.

darwin,process: feed kevent the signal to reap children (#3893)

Since we are emulating this event, but are not using the pending_queue,
we need to make sure it is accounted for properly. Also DRY some of the
reset_timeout code here.

This was observed to cause a hang in certain rare cases, particularly on
M1 machines.

Do a bit of code cleanup too, since we do not need to initialize the
internal signal handling pipe if it will not be used.

show more ...


# 2638237e 21-Jan-2023 James McCoy

build: add CI for OpenBSD and FreeBSD (#3548)

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


# 2f110a50 18-Jan-2023 Jameson Nash

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 inform

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.

show more ...


# 5102b2c0 28-Nov-2022 Ben Noordhuis

unix: drop kfreebsd support (#3835)

Because kFreeBSD is dead. RIP.

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


# e1415860 11-Nov-2022 Trevor Norris

src: add new metrics APIs (#3749)

The following metrics are now always recorded and available via the new
uv_metrics_info() API.

* loop_count: Number of event loop iterations.

src: add new metrics APIs (#3749)

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

show more ...


# e9000066 21-Oct-2022 daomingq

thread: add support for affinity (#3774)

Backported thread affinity feature and related dependency commits
from master. It will add support for those APIs: uv_cpumask_size,
uv_thread

thread: add support for affinity (#3774)

Backported thread affinity feature and related dependency commits
from master. It will add support for those APIs: uv_cpumask_size,
uv_thread_setaffinity, uv_thread_getaffinity.
The supported platforms are Linux, Freebsd, and Windows.
Empty implementations (returning UV_ENOTSUP) on non-supported platforms
(such as OS X and AIX).

show more ...


# fb76f210 21-Aug-2022 Ben Noordhuis

unix: fix uv_getrusage() ru_maxrss reporting (#3721)

Most platforms report it in kilobytes but macOS and Solaris report it in
bytes and pages respectively.

Fixes: https://github

unix: fix uv_getrusage() ru_maxrss reporting (#3721)

Most platforms report it in kilobytes but macOS and Solaris report it in
bytes and pages respectively.

Fixes: https://github.com/nodejs/node/issues/44332

show more ...


# 6c692ad1 20-Jul-2022 Ben Noordhuis

unix: don't accept() connections in a loop (#3696)

After analysis of many real-world programs I've come to conclude that
accepting in a loop is nearly always suboptimal.

1. 99.9

unix: don't accept() connections in a loop (#3696)

After analysis of many real-world programs I've come to conclude that
accepting in a loop is nearly always suboptimal.

1. 99.9% of the time the second accept() call fails with EAGAIN, meaning
there are no additional connections to accept. Not super expensive
in isolation but it adds up.

2. When there are more connections to accept but the listen socket is
shared between multiple processes (ex. the Node.js cluster module),
libuv's greedy behavior necessitated the UV_TCP_SINGLE_ACCEPT hack
to slow it down in order to give other processes a chance.

Accepting a single connection and relying on level-triggered polling to
get notified on the next incoming connection both simplifies the code
and optimizes for the common case.

show more ...


12345678910>>...12