Windows added a new API for file information, which doesn't have to
open the file thus greatly improving performance:
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyname
The stat functions are already covered by tests, so no test was added
here. I considered comparing the result of old and new code, but that
would require exposing internal fs functions, and we would be testing
Windows functionality, not libuv.
Register the eventfd with EPOLLET to enable edge-triggered notification
where we're able to eliminate the overhead of reading the eventfd via
system call on each wakeup event.
When the eventfd counter reaches the maximum value of the unsigned 64-bit,
which may not happen for the entire lifetime of the process, we rewind the
counter and retry.
This optimization saves one system call on each event-loop wakeup,
eliminating the overhead of read(2) as well as the extra latency
for each epoll wakeup.
If the corresponding environment variables are empty, the
uv_us_homedir() and uv_os_tmpdir() return garbage values. The reason
for this situation is the Windows API which doesn't return an error
even if the path is empty.
This PR fixes this problem by checking the return value of the API
call. If it is not an error and the length of the value is less than 3,
uv_us_homedir() and uv_os_tmpdir() will return UV_ENOENT.
Fixes: https://github.com/libuv/libuv/issues/2328
Under rare but benign circumstances (on XNU), incoming datagrams appear
to be dropped by the operating system after libuv has been notified of
their arrival but before libuv has had a chance to receive them.
Fixes: https://github.com/libuv/libuv/issues/4219
This was incorrectly mapped originally, which makes for confusing error
messages about an EPIPE if a program happens to (unwisely) set PIPE_WAIT
on the handle. It is unclear to me if libuv should try to handle this in
some meaningful way, and very unclear what that way would look like, but
at least expose this to the caller with the correct errno translation.
It's complaining in the post-run step about a missing symbol:
/__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version
`GLIBC_2.28' not found (required by /__e/node20/bin/node)
For now pin actions/checkout to node 16.
CreateProcessW() in uv_spawn() on Windows will fail with
ERROR_BAD_EXE_FORMAT if attempting to run a file that is not
an executable.
Refs: https://github.com/libuv/libuv/issues/2348
On IBM AIX (and PASE for IBM i), use st_timespec_t
when _XOPEN_SOURCE>=700 and _ALL_SOURCE is defined.
Signed-off-by: Jeffrey H. Johnson <trnsz@pobox.com>
This commit changes the timestamps in the file, the ownership and the
group.
Fixes: https://github.com/libuv/libuv/issues/3125
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Should hopefully make it easier to debug CI flakiness because
currently the test sometimes fails without a clear indication why.
Refs: https://github.com/libuv/libuv/issues/4106
Make it less likely for the thread-local error value to get
clobbered between performing the operation and checking the result.
Refs: https://github.com/libuv/libuv/issues/4338
The file descriptor leak in the inner path was pointed out by @theanarkh
and I subsequently spotted another one in the outer loop. Rewrite the
function to process all control messages.
Refs: https://github.com/libuv/libuv/pull/4357
Benchmarking shows that sendmsg() is persistently around 1% faster for
single datagrams, and that kind of stands to reason because there is
less setup overhead, and the kernel has to copy in less data.
Fixes: https://github.com/libuv/libuv/issues/4320
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
Perform EPOLL_CTL_DEL immediately instead of going through
io_uring's submit queue, otherwise the file descriptor may
be closed by the time the kernel starts the operation.
Fixes: https://github.com/libuv/libuv/issues/4323