Commit Graph

229 Commits

Author SHA1 Message Date
Jameson Nash
29a708a434 2024.02.07, Version 1.48.0 (Stable)
Changes since version 1.47.0:
 
 * misc: remove deprecated stalebot file (Jameson Nash)
 
 * build: disable windows asan buildbot (Ben Noordhuis)
 
 * test: don't run tcp_writealot under msan (Ben Noordhuis)
 
 * build,win: remove extraneous -lshell32 (Ben Noordhuis)
 
 * unix: ignore ifaddrs with NULL ifa_addr (Stephen Gallagher)
 
 * unix,win: utility for setting priority for thread (Hao Hu)
 
 * pipe: add back error handling to connect / bind (Jameson Nash)
 
 * test: check if ipv6 link-local traffic is routable (Ben Noordhuis)
 
 * win: remove check for UV_PIPE_NO_TRUNCATE (Jameson Nash)
 
 * linux: disable io_uring on hppa below kernel 6.1.51 (matoro)
 
 * unix,win: fix read past end of pipe name buffer (Ben Noordhuis)
 
 * unix: unbreak macOS < 10.14 (Sergey Fedorov)
 
 * aix: disable ipv6 link local (Abdirahim Musse)
 
 * doc: move cjihrig to emeriti (cjihrig)
 
 * unix: correct pwritev conditional (Bo Anderson)
 
 * test_fs.c: Fix issue on 32-bit systems using btrfs (Stephen Gallagher)
 
 * misc: ignore libuv-release-tool files (Jameson Nash)
 
 * win: honor NoDefaultCurrentDirectoryInExePath env var (Ardi Nugraha)
 
 * idna: fix compilation warning (Saúl Ibarra Corretgé)
 
 * linux: remove HAVE_IFADDRS_H macro (Ben Noordhuis)
 
 * test: skip tcp-write-in-a-row on IBM i (Abdirahim Musse)
 
 * build,win: work around missing uuid.dll on MinGW (Anton Bachin)
 
 * win: stop using deprecated names (Matheus Izvekov)
 
 * unix,win: fix busy loop with zero timeout timers (Matheus Izvekov)
 
 * aix,ibmi: use uv_interface_addresses instead of getifaddrs (Abdirahim Musse)
 
 * linux: fix bind/connect for abstract sockets (Santiago Gimeno)
 
 * win: replace c99 comments with c89 comments (Trevor Flynn)
 
 * build: add .cache clangd folder to .gitignore (Juan José Arboleda)
 
 * unix: support full TCP keep-alive on Solaris (Andy Pan)
 
 * freebsd: fix F_KINFO file path handling (David Carlier)
 
 * linux: retry fs op if unsupported by io_uring (Santiago Gimeno)
 
 * freebsd: fix build on non-intel archs (David Carlier)
 
 * unix: optimize uv__tcp_keepalive cpp directives (Andy Pan)
 
 * linux: disable io_uring on ppc64 and ppc64le (Brad King)
 
 * doc: add very basic Security Policy document (Santiago Gimeno)
 
 * build: re-enable msvc-asan job on CI (Jameson Nash)
 
 * win/spawn: optionally run executable paths with no file extension (Brad King)
 
 * win: fix ESRCH implementation (Jameson Nash)
 
 * unix,win: reset the timer queue on stop (Santiago Gimeno)
 
 * fix: always zero-terminate idna output (Ben Noordhuis)
 
 * fix: reject zero-length idna inputs (Ben Noordhuis)
 
 * test: empty strings are not valid IDNA (Santiago Gimeno)
 
 * Merge pull request from GHSA-f74f-cvh7-c6q6 (Ben Noordhuis)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEYS8OrZQBYiN530QC8ow8jaM8A74FAmXD5fwACgkQ8ow8jaM8
 A76H+g/9F2O6hXWfm5LACvIRhcDovK1NLprTp5Ae5qA9klSDzClxi6n7/B9NtDhv
 X2EwEXhQpc/Y600dbfcmKr6P5Gt2FDhjO3iy9gCrkUN+ZHV7kRCb8dmp+eyGcOag
 uKqkkpZN6aiT0Jp4H4x66VnSotvLeilHzs16+A3/r5wUNmqzhj0cG/UVaDyZfYEH
 NCqv5MFw2N9qO5lnsu2g1sDEujnjWhXUcY9D1vVUDf63CU09n+lz1LKRB5LKEGRy
 bPF/IjuxJAJQA+gsgj1dP2nuUH8IGhNOpkQ2WG8wEuPp6hahGvND4YovP/sDY7pV
 9oo+73v1boAlYVS9IhAINVnKiPJx7tHJQvMcmgezSBCrd6v+PoWfL4A9oAWOp1qX
 ju+PC2Xk7E9Kt5gC9hjDzdMt6nw7Ab5pJ3ZcVF/2Sq27w0T4nxAOOpAt7JnJ53ug
 o26RWlO9NvBe30Uh2fwqye1UuL17Qjo7Y+ztrMQGmeV+RW693xqZ/bnVOhQupfqI
 fJNl1BBgInT9IU+A8ZtHeDuRf04hEit0rzS/yGrcHa1bHEHorG5W52nazYIsQURM
 hwWBDQ2dH2iTogHGdQ/CKdMGwuo+RwCavBXCHu03jf10hy+ImHF5ifJA7WLeH0oF
 QlCmeJl/26sOHlEa7wQnjhzh7YNg6JDuq6K22a9iR5vnduK1ByU=
 =67rH
 -----END PGP SIGNATURE-----

Merge tag 'v1.48.0' into merge_1.48.0
2024-02-09 19:52:08 +00:00
Santiago Gimeno
160cd5629e
linux: retry fs op if unsupported by io_uring (#4268)
Fallback to the threadpool if it returns `EOPNOTSUPP`.

Fixes: https://github.com/nodejs/node/issues/50876
2024-01-08 22:25:44 +01:00
Jameson Nash
633629e8e7 2023.06.30, Version 1.46.0 (Stable)
Changes since version 1.45.0:
 
 * Add SHA to ChangeLog (Santiago Gimeno)
 
 * misc: update readthedocs config (Jameson Nash)
 
 * test: remove erroneous RETURN_SKIP (Ben Noordhuis)
 
 * android: disable io_uring support (Ben Noordhuis)
 
 * linux: add some more iouring backed fs ops (Santiago Gimeno)
 
 * build: add autoconf option for disable-maintainer-mode (Jameson Nash)
 
 * fs: use WTF-8 on Windows (Stefan Karpinski)
 
 * unix,win: replace QUEUE with struct uv__queue (Ben Noordhuis)
 
 * linux: fs_read to use io_uring if iovcnt > IOV_MAX (Santiago Gimeno)
 
 * ios: fix uv_getrusage() ru_maxrss calculation (Ben Noordhuis)
 
 * include: update outdated code comment (Ben Noordhuis)
 
 * linux: support abstract unix sockets (Ben Noordhuis)
 
 * unix,win: add UV_PIPE_NO_TRUNCATE flag (Ben Noordhuis)
 
 * unix: add loongarch support (liuxiang88)
 
 * doc: add DPS8M to LINKS.md (Jeffrey H. Johnson)
 
 * include: add EUNATCH errno mapping (Abdirahim Musse)
 
 * src: don't run timers if loop is stopped/unref'd (Trevor Norris)
 
 * win: fix -Wpointer-to-int-cast warning (Ben Noordhuis)
 
 * test,win: fix -Wunused-variable warning (Ben Noordhuis)
 
 * test,win: fix -Wformat warning (Ben Noordhuis)
 
 * linux: work around io_uring IORING_OP_CLOSE bug (Ben Noordhuis)
 
 * win: remove unused functions (Ben Noordhuis)
 
 * bench: add bench to check uv_loop_alive (Trevor Norris)
 
 * test: add uv_cancel test for threadpool (Trevor Norris)
 
 * unix: skip prohibited syscalls on tvOS and watchOS (小明)
 
 * unix,fs: make no_pwritev access thread-safe (Santiago Gimeno)
 
 * unix: fix build for lower versions of Android (小明)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEYS8OrZQBYiN530QC8ow8jaM8A74FAmSfH5cACgkQ8ow8jaM8
 A77NnBAAkAE2anAM7xLaTaz9bdFLMH8eegpDRKcwcui6Z4gf84whgLBSWrJ34JVe
 wDKMmwB1fDQfV+GeZY7AI8Z9V7v+1T1FRwT/Gb63dG+Z+sHBTBl/olGIj8jxRDV4
 p42M0MBUW03NVeGdxsXHNy8mgbM0oDU7Ko+QU8X41hCT+2wQ2NOp+BBImMeNRAKQ
 wb1766zocxuR0nmasIf2sg8WC87H5YSzpqJ/0yftBy9dBbcd3EU2IJfHGWWuijuA
 cT8ohREb+TAIL/m0iKfEc2Ft4iWDaziabC/d62VwrVzKEokvCZwf7Uqjm/J+U7iT
 ovGxq/dL+5/+7R2upm9Y8+6yiTDSuvpfJS/REEdMfKocaB2KhIG2CHuc2ejKyxo1
 7rxEziJ481f1CS6wMH5qsvnUvcb+WtHoLXgzBabBTg8ul/zwTxgNdXCZCzjS1+tv
 PjL/zLJGeDMIibZ5oEoKc8Ce080YpH5rxFZRJn3Aheqp+ZXkoFNygdYSs3oD+rGU
 V32FnRXQmWCcZjsgS7LWk/ufCJm/lw9z4cyN/YkINEmgdMzrTVk7e/SIW4AdnkJ7
 CyBwOH5m96dLfwTXExfUm1x+2pmzq1CX10iVbe+180n53i1rf++DU5eA8Dr0LCRF
 jcB+0UrMAq/eYB/+JfQVUflvPlduFsFlLffnOCMv4HPbjKdkOoU=
 =LjtZ
 -----END PGP SIGNATURE-----

Merge tag 'v1.46.0' into merge_1.46.0
2023-11-14 14:29:02 +00:00
Jameson Nash
4e774df4cc 2023.05.19, Version 1.45.0 (Stable)
Changes since version 1.44.2:
 
 * win: remove stdint-msvc2008.h (Ben Noordhuis)
 
 * android: remove pthread-fixes.c (Ben Noordhuis)
 
 * build: enable MSVC_RUNTIME_LIBRARY setting (自发对称破缺)
 
 * unix: switch to c11 atomics (Ben Noordhuis)
 
 * unix: don't accept() connections in a loop (Ben Noordhuis)
 
 * win: fix off-by-1 buffer overrun in uv_exepath() (Ben Noordhuis)
 
 * build: switch ci from macos-10.15 to macos-11 (Ben Noordhuis)
 
 * win: fix thread race in uv_cwd() and uv_chdir() (Ben Noordhuis)
 
 * unix,win: remove UV_HANDLE_SHUTTING flag (Santiago Gimeno)
 
 * win: support Windows 11 in uv_os_uname() (Luan Devecchi)
 
 * unix: fix uv_getrusage() ru_maxrss reporting (Ben Noordhuis)
 
 * doc: add note about offset -1 in uv_fs_read/write (Steven Schveighoffer)
 
 * test: fix musl libc.a dlerror() test expectation (Ben Noordhuis)
 
 * kqueue: DRY file descriptor deletion logic (Ben Noordhuis)
 
 * linux: teach uv_get_constrained_memory() cgroupsv2 (Ben Noordhuis)
 
 * build: upgrade qemu-user-static package (Ben Noordhuis)
 
 * linux: move epoll.c back into linux-core.c (Ben Noordhuis)
 
 * unix: remove pre-macos 10.8 compatibility hack (Ben Noordhuis)
 
 * unix,win: fix memory leak in uv_fs_scandir() (Ben Noordhuis)
 
 * build: restore qemu download logic (Ben Noordhuis)
 
 * win: fix uv__pipe_accept memory leak (number201724)
 
 * doc: update LINKS.md (Daniel)
 
 * unix: simplify atomic op in uv_tty_reset_mode() (Ben Noordhuis)
 
 * build: add LIBUV_BUILD_SHARED cmake option (Christian Clason)
 
 * linux: remove unused or obsolete syscall wrappers (Ben Noordhuis)
 
 * linux: merge files back into single file (Ben Noordhuis)
 
 * stream: process more than one write req per loop tick (ywave620)
 
 * unix,win: give thread pool threads an 8 MB stack (Ben Noordhuis)
 
 * build: add MemorySanitizer (MSAN) support (Ben Noordhuis)
 
 * doc: add uv_poll_cb status==UV_EBADF note (jensbjorgensen)
 
 * build: support AddressSanitizer on MSVC (Jameson Nash)
 
 * win,pipe: improve method of obtaining pid for ipc (number201724)
 
 * thread: add support for affinity (daomingq)
 
 * include: map ENODATA error code (Ben Noordhuis)
 
 * build: remove bashism from autogen.sh (Santiago Gimeno)
 
 * win,tcp,udp: remove "active streams" optimization (Saúl Ibarra Corretgé)
 
 * win: drop code checking for Windows XP / Server 2k3 (Saúl Ibarra Corretgé)
 
 * unix,win: fix 'sprintf' is deprecated warning (twosee)
 
 * doc: mention close_cb can be NULL (Qix)
 
 * win: optimize udp receive performance (ywave620)
 
 * win: fix an incompatible types warning (twosee)
 
 * doc: document 0 return value for free/total memory (Ben Noordhuis)
 
 * darwin: use hw.cpufrequency again for frequency info (Jameson Nash)
 
 * win,test: change format of TEST_PIPENAME's (Santiago Gimeno)
 
 * win,pipe: fixes in uv_pipe_connect() (Santiago Gimeno)
 
 * misc: fix return value of memory functions (theanarkh)
 
 * src: add new metrics APIs (Trevor Norris)
 
 * thread: add uv_thread_getcpu() (daomingq)
 
 * build: don't use ifaddrs.h on solaris 10 (Edward Humes)
 
 * unix,win: add uv_get_available_memory() (Tim Besard)
 
 * test: fix -Wunused-but-set-variable warnings (Ben Noordhuis)
 
 * doc: bump min supported linux and freebsd versions (Ben Noordhuis)
 
 * Add Socket Runtime to the LINKS.md (Sergey Rubanov)
 
 * unix: drop kfreebsd support (Ben Noordhuis)
 
 * win: fix fstat for pipes and character files (Stefan Stojanovic)
 
 * win: fix -Wunused-variable warning (Ben Noordhuis)
 
 * win: fix -Wunused-function warning (Ben Noordhuis)
 
 * build: drop qemu-alpha from ci matrix (Ben Noordhuis)
 
 * win: move child_stdio_buffer out of uv_process_t (Santiago Gimeno)
 
 * test: fix some unreachable code warnings (Santiago Gimeno)
 
 * linux: simplify uv_uptime() (Ben Noordhuis)
 
 * test: unflake fs_event_watch_dir test (Ben Noordhuis)
 
 * darwin: remove unused fsevents symbol lookups (Ben Noordhuis)
 
 * build: add define guard around UV_EXTERN (Zvicii)
 
 * build: add UndefinedBehaviorSanitizer support (Ben Noordhuis)
 
 * build: enable platform_output test on qemu (Ben Noordhuis)
 
 * linux: handle cpu hotplugging in uv_cpu_info() (Ben Noordhuis)
 
 * build: remove unnecessary policy setting (dundargoc)
 
 * docs: add vcpkg instruction step (Jack·Boos·Yu)
 
 * win,fs: fix readlink errno for a non-symlink file (Darshan Sen)
 
 * misc: extend getpw to take uid as an argument (Jameson Nash)
 
 * unix,win: use static_assert when available (Ben Noordhuis)
 
 * docs: delete code Makefile (Jameson Nash)
 
 * docs: add CI for docs PRs (Jameson Nash)
 
 * docs: update Sphinx version on RTD (Jameson Nash)
 
 * doc: clean up license file (Ben Noordhuis)
 
 * test: fix some warnings when compiling tests (panran)
 
 * build,win: add mingw-w64 CI configuration (Jameson Nash)
 
 * build: add CI for distcheck (Jameson Nash)
 
 * unix: remove busy loop from uv_async_send (Jameson Nash)
 
 * doc: document uv_fs_cb type (Tamás Bálint Misius)
 
 * build: Improve build by cmake for Cygwin (erw7)
 
 * build: add libuv:: namespace to libuvConfig.cmake (AJ Heller)
 
 * test: fix ThreadSanitizer thread leak warning (Ben Noordhuis)
 
 * test: fix ThreadSanitizer data race warning (Ben Noordhuis)
 
 * test: fix ThreadSanitizer data race warning (Ben Noordhuis)
 
 * test: fix ThreadSanitizer data race warning (Ben Noordhuis)
 
 * test: cond-skip fork_threadpool_queue_work_simple (Ben Noordhuis)
 
 * test: cond-skip signal_multiple_loops (Ben Noordhuis)
 
 * test: cond-skip tcp_writealot (Ben Noordhuis)
 
 * build: promote tsan ci to must-pass (Ben Noordhuis)
 
 * build: add CI for OpenBSD and FreeBSD (James McCoy)
 
 * build,test: fix distcheck errors (Jameson Nash)
 
 * test: remove bad tty window size assumption (Ben Noordhuis)
 
 * darwin,process: feed kevent the signal to reap children (Jameson Nash)
 
 * unix: abort on clock_gettime() error (Ben Noordhuis)
 
 * test: remove timing-sensitive check (Ben Noordhuis)
 
 * unix: DRY and fix tcp bind error path (Jameson Nash)
 
 * macos: fix fsevents thread race conditions (Ben Noordhuis)
 
 * win: fix leak in uv_chdir (Trevor Norris)
 
 * test: make valgrind happy (Trevor Norris)
 
 * barrier: wait for prior out before next in (Jameson Nash)
 
 * test: fix visual studio 2015 build error (Ben Noordhuis)
 
 * linux: fix ceph copy error truncating readonly files (Bruno Passeri)
 
 * test: silence more valgrind warnings (Trevor Norris)
 
 * doc: add entries to LINKS.md (Trevor Norris)
 
 * win,unix: change execution order of timers (Trevor Norris)
 
 * doc: add trevnorris to maintainers (Trevor Norris)
 
 * linux: remove epoll_pwait() emulation code path (Ben Noordhuis)
 
 * linux: replace unsafe macro with inline function (Ben Noordhuis)
 
 * linux: remove arm oabi support (Ben Noordhuis)
 
 * unix,sunos: SO_REUSEPORT not valid on all sockets (Stacey Marshall)
 
 * doc: consistent single backquote in misc.rst (Jason Zhang)
 
 * src: switch to use C11 atomics where available (Trevor Norris)
 
 * test: don't use static buffer for formatting (Ben Noordhuis)
 
 * linux: introduce io_uring support (Ben Noordhuis)
 
 * linux: fix academic valgrind warning (Ben Noordhuis)
 
 * test: disable signal test under ASan and MSan (Ben Noordhuis)
 
 * linux: add IORING_OP_OPENAT support (Ben Noordhuis)
 
 * linux: add IORING_OP_CLOSE support (Ben Noordhuis)
 
 * linux: remove bug workaround for obsolete kernels (Ben Noordhuis)
 
 * doc: update active maintainers list (Ben Noordhuis)
 
 * test: add ASSERT_OK (Trevor Norris)
 
 * src: fix events/events_waiting metrics counter (Trevor Norris)
 
 * unix,win: add uv_clock_gettime() (Ben Noordhuis)
 
 * build: remove freebsd and openbsd buildbots (Ben Noordhuis)
 
 * win: fix race condition in uv__init_console() (sivadeilra)
 
 * linux: fix logic bug in sqe ring space check (Ben Noordhuis)
 
 * linux: use io_uring to batch epoll_ctl calls (Ben Noordhuis)
 
 * macos: update minimum supported version (Santiago Gimeno)
 
 * docs: fix some typos (cui fliter)
 
 * unix: use memcpy() instead of type punning (Ben Noordhuis)
 
 * test: add additional assert (Mohammed Keyvanzadeh)
 
 * build: export compile_commands.json (Lewis Russell)
 
 * win,process: write minidumps when sending SIGQUIT (Elliot Saba)
 
 * unix: constrained_memory should return UINT64_MAX (Tim Besard)
 
 * unix: handle CQ overflow in iou ring (Santiago Gimeno)
 
 * unix: remove clang compiler warning pragmas (Ben Noordhuis)
 
 * win: fix mingw build (gengjiawen)
 
 * test: fix -Wbool-compare compiler warning (Ben Noordhuis)
 
 * win: define MiniDumpWithAvxXStateContext always (Santiago Gimeno)
 
 * freebsd: hard-code UV_ENODATA definition (Santiago Gimeno)
 
 * linux: work around EOWNERDEAD io_uring kernel bug (Ben Noordhuis)
 
 * linux: fix WRITEV with lots of bufs using io_uring (Santiago Gimeno)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEYS8OrZQBYiN530QC8ow8jaM8A74FAmRnW50ACgkQ8ow8jaM8
 A76noBAAiavsCBvAC554x4Naic+B3fEYjKnLe8OLTbdN4XQsS2uSkCEuP0TuwLE7
 Q93CHgDFcL//XmNAXwIKMIvZ7G25zga93qxrZdd7Hsuthg5oJwsrZb8faHG7CeKy
 Fq+SLCUdLcwOR9m9RDp1u3h/pIhoqQvLUlPcBvDKVaJOVhIngawKU/vC125z6ZJs
 CYaKMlPbU2WjIkkoQjNRYL8oolmWTs5T/8AhIVWntTCyc/+/n7uxmWwlfL2iR8Kj
 u5IT7Vhh6a7VC+dGh26k/FN0RGdAgJCZ1Jnrt+llHxRVuw0xEBnrTAyS3hOkA7Me
 s+8VUaCsreVi9p66hqE5b4IL5e9yUEB18A5dQBY+TFNeXaQETVg9BxPMXbhoh+XB
 2643LZn/kN1iilZBMSMl9kqB66qeUihv8cvjMnrTzq+nSxJvuc13XPfbH+zhMkVh
 CQaFMq3v5vc4Kyk2YrjcsfGCIkRxRGlhSmk5riz1Xf+erf4GuOl+o2fA6YvVDAnE
 rzlzpGoRSHgHYC23KirkBHo7qQVbWy+NeLWFRFSHfSN4+czttdusiFSjxERavfSh
 ezRKH6dNHI8C9fqT3oAitXOgFt6AsMiYMt7JpJwPm0SdAFjIEkgjAfhkSQADUHz7
 qezLtJoCL+bcUXE8tgRRuz+J6x4FhKBZVu5uA6fV1UuyWI74DBU=
 =YAOh
 -----END PGP SIGNATURE-----

Merge tag 'v1.45.0' into merge_1.45.0
2023-05-23 09:09:41 -04:00
Santiago Gimeno
962b8e626c
linux: add some more iouring backed fs ops (#4012)
Specifically: `link`, `mkdir`, `rename`, `symlink` and `unlink`.
2023-05-23 10:42:20 +02:00
Ben Noordhuis
dfae365f84
linux: add IORING_OP_CLOSE support (#3964) 2023-04-20 10:44:16 +02:00
Ben Noordhuis
5ca5e475bb
linux: add IORING_OP_OPENAT support (#3963) 2023-04-20 10:17:06 +02:00
Ben Noordhuis
d2c31f429b
linux: introduce io_uring support (#3952)
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
2023-04-18 12:32:08 +02:00
Ben Noordhuis
28b9f1e68b
linux: replace unsafe macro with inline function (#3933)
Replace the throw-type-safety-to-the-wind CAST() macro with an inline
function that is hopefully harder to misuse. It should make the inotify
code slightly more legible if nothing else.
2023-03-31 10:09:48 +02:00
Jameson Nash
62c2374a8c
unix: DRY and fix tcp bind error path (#3904)
The conditional bind-to-port logic in tcp.c had an error path that
closed the socket file descriptor while it was still owned by the
uv_tcp_t handle.

Fix that by not closing the file descriptor and refactoring the code so
it is hopefully harder to get wrong in the future.

The refactoring also makes the code a little flatter, removes duplicated
code, and, arguably, is in a more idiomatic libuv style.

Fixes: https://github.com/libuv/libuv/issues/3461
Replaces: https://github.com/libuv/libuv/pull/3462
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2023-02-07 14:59:39 -05:00
Jameson Nash
42cc412c4a
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.
2023-02-01 13:42:26 -05:00
James McCoy
2638237e1f
build: add CI for OpenBSD and FreeBSD (#3548)
Fixes: https://github.com/libuv/libuv/issues/3510
2023-01-21 13:52:36 +01:00
Jameson Nash
2f110a50df
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.
2023-01-17 21:51:28 -06:00
Ben Noordhuis
5102b2c093
unix: drop kfreebsd support (#3835)
Because kFreeBSD is dead. RIP.

Fixes: https://github.com/libuv/libuv/issues/3833
2022-11-28 22:45:28 +01:00
Ben Noordhuis
8ddffeeea3
doc: bump min supported linux and freebsd versions (#3830)
The old Linux baseline was essentially RHEL 6 but that distro has been
out of support for two years now. Move to RHEL 7.

This commit also moves FreeBSD to tier 2 because it isn't actually
part of libuv's CI matrix, only Node's.

Fixes: https://github.com/libuv/libuv/issues/3822
2022-11-28 12:00:27 +01:00
Ben Noordhuis
acfe668ecb
build: add MemorySanitizer (MSAN) support (#3788)
- unpoison results from linux system call wrappers

- unpoison results from stat/fstat/lstat to pacify clang 14
  (fixed in later versions)

- add MSAN build option

- turn on MSAN CI build
2022-10-18 23:21:42 +02:00
Ben Noordhuis
cd1a510d16
linux: merge files back into single file (#3778)
I split up linux.c around 2012 for no real reason and now I'm merging
it back together, again for no real reason.

I half-jest. I like the idea of having everything together because I
practically forgot linux-inotify.c existed. It also makes io_uring
experiments a little easier.

Last but not least, it removes about 100 lines of license boilerplate.
2022-10-02 14:09:42 +02:00
Ben Noordhuis
d651403b47 linux: move epoll.c back into linux-core.c
epoll.c is only used on Android and Linux after commit 5fe59726 ("sunos:
restore use of event ports") so move it back into linux-core.c

This commit removes a workaround for pre-2.6.27 kernels that don't have
the epoll_create1() system call.
2022-09-19 00:24:24 +02:00
Jameson Nash
c7088010ad 2022.07.12, Version 1.44.2 (Stable)
Changes since version 1.44.1:
 
 * Add SHA to ChangeLog (Jameson Nash)
 
 * aix, ibmi: handle server hang when remote sends TCP RST (V-for-Vasili)
 
 * build: make CI a bit noisier (Jameson Nash)
 
 * process: reset the signal mask if the fork fails (Jameson Nash)
 
 * zos: implement cmpxchgi() using assembly (Shuowang (Wayne) Zhang)
 
 * build: AC_SUBST for AM_CFLAGS (Claes Nästén)
 
 * ibmi: Implement UDP disconnect (V-for-Vasili)
 
 * doc: update active maintainers list (Ben Noordhuis)
 
 * build: fix kFreeBSD build (James McCoy)
 
 * build: remove Windows 2016 workflows (Darshan Sen)
 
 * Revert "win,errors: remap ERROR_ACCESS_DENIED to UV_EACCES" (Darshan Sen)
 
 * unix: simplify getpwuid call (Jameson Nash)
 
 * build: filter CI by paths and branches (Jameson Nash)
 
 * build: add iOS to macos CI (Jameson Nash)
 
 * build: re-enable CI for windows changes (Jameson Nash)
 
 * process,iOS: fix build breakage in process.c (Denny C. Dai)
 
 * test: remove unused declarations in tcp_rst test (V-for-Vasili)
 
 * core: add thread-safe strtok implementation (Guilherme Íscaro)
 
 * win: fix incompatible-types warning (twosee)
 
 * test: fix flaky file watcher test (Ben Noordhuis)
 
 * build: fix AIX xlc autotools build (V-for-Vasili)
 
 * unix,win: fix UV_RUN_ONCE + uv_idle_stop loop hang (Ben Noordhuis)
 
 * win: fix unexpected ECONNRESET error on TCP socket (twosee)
 
 * doc: make sample cross-platform build (gengjiawen)
 
 * test: separate some static variables by test cases (Hannah Shi)
 
 * sunos: fs-event callback can be called after uv_close() (Andy Fiddaman)
 
 * uv: re-register interest in a file after change (Shuowang (Wayne) Zhang)
 
 * uv: register UV_RENAME event for _RFIM_UNLINK (Shuowang (Wayne) Zhang)
 
 * uv: register __rfim_event 156 as UV_RENAME (Shuowang (Wayne) Zhang)
 
 * doc: remove smartos from supported platforms (Ben Noordhuis)
 
 * macos: avoid posix_spawnp() cwd bug (Jameson Nash)
 
 * release: check versions of autogen scripts are newer (Jameson Nash)
 
 * test: rewrite embed test (Ben Noordhuis)
 
 * openbsd: use utimensat instead of lutimes (tuftedocelot)
 
 * doc: fix link to uvwget example main() function (blogdaren)
 
 * unix: use MSG_CMSG_CLOEXEC where supported (Ben Noordhuis)
 
 * test: remove disabled callback_order test (Ben Noordhuis)
 
 * win,pipe: fix bugs with pipe resource lifetime management (Jameson Nash)
 
 * loop: better align order-of-events behavior between platforms (Jameson Nash)
 
 * aix,test: uv_backend_fd is not supported by poll (V-for-Vasili)
 
 * kqueue: skip EVFILT_PROC when invalidating fds (chucksilvers)
 
 * darwin: fix atomic-ops.h ppc64 build (Sergey Fedorov)
 
 * zos: don't err when killing a zombie process (Shuowang (Wayne) Zhang)
 
 * zos: avoid fs event callbacks after uv_close() (Shuowang (Wayne) Zhang)
 
 * zos: correctly format interface addresses names (Shuowang (Wayne) Zhang)
 
 * zos: add uv_interface_addresses() netmask support (Shuowang (Wayne) Zhang)
 
 * zos: improve memory management of ip addresses (Shuowang (Wayne) Zhang)
 
 * tcp,pipe: fail `bind` or `listen` after `close` (theanarkh)
 
 * zos: implement uv_available_parallelism() (Shuowang (Wayne) Zhang)
 
 * udp,win: fix UDP compiler warning (Jameson Nash)
 
 * zos: fix early exit of epoll_wait() (Shuowang (Wayne) Zhang)
 
 * unix,tcp: fix errno handling in uv__tcp_bind() (Samuel Cabrero)
 
 * shutdown,unix: reduce code duplication (Jameson Nash)
 
 * unix: fix c99 comments (Ben Noordhuis)
 
 * unix: retry tcgetattr/tcsetattr() on EINTR (Ben Noordhuis)
 
 * docs: update introduction.rst (Ikko Ashimine)
 
 * unix,stream: optimize uv_shutdown() codepath (Jameson Nash)
 
 * zos: delay signal handling until after normal i/o (Shuowang (Wayne) Zhang)
 
 * stream: uv__drain() always needs to stop POLLOUT (Jameson Nash)
 
 * unix,tcp: allow EINVAL errno from setsockopt in uv_tcp_close_reset() (Stacey
   Marshall)
 
 * win,shutdown: improve how shutdown is dispatched (Jameson Nash)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEz7ucqaW+r9cOKzxaeaZ8VaNnnIsFAmLNnoYACgkQeaZ8VaNn
 nIsPiRAApE7tNUEknH+7SJ//K910PA0GM8E9/tz8PFN5LDsVlIDa9p40IezhbjMu
 O3CbA9rPZfugohV8LJ+tDxAEqzPQmb4tLZ1jyzrTCm2RSS56MtJKhPXKKchITzb2
 bAV4PNRsnzmZfMd/nJfVpTsBCf/rGOhJwFDChVVHkZgj+BibsYaipMUUwbm3XjCP
 fdzmhxh0EbCBsMWi8dxuV2R/FliaaH4PoZjvwJvk35mxN4H6ZhU/09Q9mvduljM8
 fK3pgqGwge7D0dVoybeAkMDfhMpPkGBEhH6Zif8EkLLdUB1u4EO4lxlPjr4t6aL+
 2VoHqBAWcLk3MGFh9cIRtSWG41RnEtPFJPC5SXBzqMpF28bKGb3DYc9pxl+OkrHW
 74UaDiXt446ccMlC3aF6kUbwNAHjYx6pthGPuKTxiPQPn38LE0KZbLH+G7dsRqQ/
 DP3+s/UJR4D4IV8rrE3ys6UgTQrCU42gsA2psk6KLYGPaZw/boc7f+X8JOsP8W0g
 2zwtmb27ustJQ/06MFhL2wC3J9x4cP9wdZyGSTwTbyXZ5pPQphrSinP/J8KFl5D+
 gOEQjuGcyy1beLIsq5sHQz6HCkLGekMTEdz37PqU2+TMd/4VcBmzGvHx1ACPRZdF
 ljx3dbCE3w9lSbpOxM9DYONuRmfLSeroItLrhxEBL9xKbpKOZ2I=
 =C1zG
 -----END PGP SIGNATURE-----

Merge tag 'v1.44.2' into merge_1.44.2
2022-08-01 14:49:47 -04:00
Ben Noordhuis
06948c6ee5
android: remove pthread-fixes.c (#3674)
This was a kludge for a bug in old versions (API level <= 16) of the
Android SDK.

The os390 port had a build dependency on the file but does not actually
use it so that too has been removed.
2022-07-15 11:18:38 +02:00
V-for-Vasili
5ec89b8c50
aix, ibmi: handle server hang when remote sends TCP RST (#3482)
Workaround getsockname() not working for a TCP handle that has
received RST from the remote.

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
2022-03-10 23:53:04 +00:00
Jameson Nash
cd7b33887f 2022.03.09, Version 1.44.1 (Stable)
Changes since version 1.44.0:
 
 * process: simplify uv__write_int calls (Jameson Nash)
 
 * macos: don't use thread-unsafe strtok() (Ben Noordhuis)
 
 * process: fix hang after NOTE_EXIT (Jameson Nash)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEz7ucqaW+r9cOKzxaeaZ8VaNnnIsFAmIo6e4ACgkQeaZ8VaNn
 nIubZRAAiD6sTkaYpvgXTDD0C9M3HMOms3bL9O23T2Ggtzwnzek1iwZys8KQlhn8
 mhTK+HIT610zcdqOgLE+YLYrtzspb61/8/QSDFoTX1m69rO4WXiW6fejOq6b8fu5
 cIBgqFUf2gVCulBcmqBJ83OL/EPJZmuH9fpEp6LVA74DxDQwlwGXVgTivDZtPEZQ
 thcElPuqlvpyTid42qMhug8DGAR37/qrCiQHUUGX1RWQJkSSMNPSVgXNBWaylO+g
 j3nTp3R5KrutXWa2wFpVx+KzdEP4eDanyL67A/fffHAcEIoSjmha2V+uOCInfDqU
 3Dn4jGTqS9Dc/mlxAxytqnhCFxiYPIPJcLlKJpkg5ygsmSOzx1cvkjkAyhG7A/XD
 44j9dn5rUK95r34anfmBdzCkJvX+vvODJTvgGJ2hjBU63BBeq5xtwtAf/8sLl4y/
 /HzmfVXgCHnWV5U6AHeaSsOOh5nLCV5Q0HpAVn10aIB7s+gaaR5Dfp/FJxdGoVeD
 6fgTkmeyLLXPAyhDZAXO3cE4AfPvlbeQfSAwBEB1m5Cbk5eZ1fj7hoIFwfF6RNQJ
 /hCUTKeNNVi0bx4b2xUAPfjmDABHVCzVTMkdb1xYRjOT2MkI5f1ycz9YZOkRLS/V
 WQEBCermlubQ8Pl1rByxW/GcQrs33PDnjk4KB+blr7+Y6kHplLA=
 =gJmZ
 -----END PGP SIGNATURE-----

Merge tag 'v1.44.1' into merge_1.44.1
2022-03-09 15:57:53 -05:00
Jameson Nash
20a2b1c341
unix: remove uv__cloexec_ioctl() (#3515)
Now that uv__cloexec_fcntl() is simplified
(https://github.com/libuv/libuv/pull/3492), there is no benefit to
maintaining duplicate code paths for the same thing.
2022-03-06 15:01:33 -05:00
David CARLIER
993e9ebd07
freebsd: use copy_file_range() in uv_fs_sendfile() (#3496)
Use copy_file_range() on FreeBSD 13 and above.
2022-02-27 11:49:29 +01:00
Vittore F. Scolari
7ae0c9543d
hurd: unbreak build on GNU/Hurd (#3450)
The GNU/Hurd platform does not define IP_ADD_SOURCE_MEMBERSHIP,
IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_SOURCE_GROUP and 
MCAST_LEAVE_SOURCE_GROUP.

Implement a few functions for the GNU/Hurd. Specifically:

* uv_resident_set_memory (from Linux)
* uv_get_free_memory (from Linux)
* uv_get_total_memory (from Linux)
* uv_cpu_info (from cygwin)
* uv__process_title_cleanup (void)
* uv_get_constrained_memory (stub)
* Leave proctitle unimplemented on Hurd for now
* Implement hurdish uv_exepath
* Enable ifaddrs api
* Unbreak udp basics
* Unbreak futime and lutime on Hurd
2022-02-23 12:04:18 -05:00
Jameson Nash
d54c92e3e6
win: fix style nits [NFC] (#3474)
Internal functions usually have a uv__ prefix.
2022-02-15 10:13:24 -05:00
Jameson Nash
953f901dd2
process,bsd: handle kevent NOTE_EXIT failure (#3451)
The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: https://github.com/libuv/libuv/pull/3441
Refs: https://github.com/libuv/libuv/pull/3257
2022-02-01 15:27:12 -05:00
Jeremy Rose
d9e90857f0
process: monitor for exit with kqueue on BSDs (#3441)
This adds a workaround for an xnu kernel bug that sometimes results in
SIGCHLD not being delivered. The workaround is to use kevent to listen
for EVFILT_PROC/NOTE_EXIT events instead of relying on SIGCHLD on *BSD.
 
Apple rdar: FB9529664
Refs: https://github.com/libuv/libuv/pull/3257
2022-01-31 14:49:22 -05:00
Jameson Nash
4fe755bc5b 2021.07.21, Version 1.42.0 (Stable)
Changes since version 1.41.0:
 
 * doc: fix code highlighting (Darshan Sen)
 
 * test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros (tjarlama)
 
 * zos: build in ascii code page (Shuowang (Wayne) Zhang)
 
 * zos: don't use nanosecond timestamp fields (Shuowang (Wayne) Zhang)
 
 * zos: introduce zoslib (Shuowang (Wayne) Zhang)
 
 * zos: use strnlen() from zoslib (Shuowang (Wayne) Zhang)
 
 * zos: use nanosleep() from zoslib (Shuowang (Wayne) Zhang)
 
 * zos: use __getargv() from zoslib to get exe path (Shuowang (Wayne) Zhang)
 
 * zos: treat __rfim_utok as binary (Shuowang (Wayne) Zhang)
 
 * zos: use execvpe() to set environ explictly (Shuowang (Wayne) Zhang)
 
 * zos: use custom proctitle implementation (Shuowang (Wayne) Zhang)
 
 * doc: add instructions for building on z/OS (Shuowang (Wayne) Zhang)
 
 * linux,udp: enable full ICMP error reporting (Ondřej Surý)
 
 * test: fix test-udp-send-unreachable (Ondřej Surý)
 
 * include: fix typo in documentation (Tobias Nießen)
 
 * chore: use for(;;) instead of while (Yash Ladha)
 
 * test: remove string + int warning on udp-pummel (Juan José Arboleda)
 
 * cmake: fix linker flags (Zhao Zhili)
 
 * test: fix stack-use-after-scope (Zhao Zhili)
 
 * unix: expose thread_stack_size() internally (Brandon Cheng)
 
 * darwin: use RLIMIT_STACK for fsevents pthread (Brandon Cheng)
 
 * darwin: abort on pthread_attr_init fail (Brandon Cheng)
 
 * benchmark: remove unreachable code (Matvii Hodovaniuk)
 
 * macos: fix memleaks in uv__get_cpu_speed (George Zhao)
 
 * Make Thread Sanitizer aware of file descriptor close in uv__close() (Ondřej
   Surý)
 
 * darwin: fix iOS compilation and functionality (Hayden)
 
 * linux: work around copy_file_range() cephfs bug (Ben Noordhuis)
 
 * zos: implement uv_get_constrained_memory() (Shuowang (Wayne) Zhang)
 
 * zos: fix uv_get_free_memory() (Shuowang (Wayne) Zhang)
 
 * zos: use CVTRLSTG to get total memory accurately (Shuowang (Wayne) Zhang)
 
 * ibmi: Handle interface names longer than 10 chars (Kevin Adler)
 
 * docs: update read-the-docs version of sphinx (Jameson Nash)
 
 * unix: refactor uv_try_write (twosee)
 
 * linux-core: add proper divide by zero assert (yiyuaner)
 
 * misc: remove unnecessary _GNU_SOURCE macros (Darshan Sen)
 
 * test: log to stdout to conform TAP spec (bbara)
 
 * win,fs: fix C4090 warning with MSVC (SeverinLeonhardt)
 
 * build: some systems provide dlopen() in libc (Andy Fiddaman)
 
 * include: add EOVERFLOW status code mapping (Darshan Sen)
 
 * unix,fs: use uv__load_relaxed and uv__store_relaxed (Darshan Sen)
 
 * win: fix string encoding issue of uv_os_gethostname (Eagle Liang)
 
 * unix,process: add uv__write_errno helper function (Ricky Zhou)
 
 * Re-merge "unix,stream: clear read/write states on close/eof" (Jameson Nash)
 
 * unix,core: fix errno handling in uv__getpwuid_r (Darshan Sen)
 
 * errors: map ESOCKTNOSUPPORT errno (Ryan Liptak)
 
 * doc: uv_read_stop always succeeds (Simon Kissane)
 
 * inet: fix inconsistent return value of inet_ntop6 (twosee)
 
 * darwin: fix -Wsometimes-uninitialized warning (twosee)
 
 * stream: introduce uv_try_write2 function (twosee)
 
 * poll,win: UV_PRIORITIZED option should not assert (twosee)
 
 * src: DragonFlyBSD has mmsghdr struct too (David Carlier)
 
 * cleanup,win: Remove _WIN32 guards on threadpool (James M Snell)
 
 * freebsd: fix an incompatible pointer type warning (Darshan Sen)
 
 * core: Correct the conditionals for {cloexec,nonblock}_ioctl (Ali Mohammad
   Pur)
 
 * win,tcp: make uv_close work more like unix (Jameson Nash)
 
 * doc: more accurate list of valid send_handle's (twosee)
 
 * win,tcp: translate system errors correctly (twosee)
 
 * unix: implement cpu_relax() on ppc64 (Ben Noordhuis)
 
 * docs: move list of project links under PR control (Jameson Nash)
 
 * test: wrong pointer arithmetic multiplier (Erkhes N)
 
 * doc: switch discussion forum to github (Jameson Nash)
 
 * idna: fix OOB read in punycode decoder (Ben Noordhuis)
 
 * build: make sure -fvisibility=hidden is set (Santiago Gimeno)
 
 * illumos: event ports to epoll (tjarlama)
 
 * illumos,tty: UV_TTY_MODE_IO waits for 4 bytes (Joshua M. Clulow)
 
 * doc: add vtjnash GPG ID (Jameson Nash)
 
 * linux: read CPU model information on ppc (Richard Lau)
 
 * darwin: fix uv_barrier race condition (Guilherme Íscaro)
 
 * unix,stream: fix loop hang after uv_shutdown (Jameson Nash)
 
 * doc,udp: note that suggested_size is 1 max-sized dgram (Ryan Liptak)
 
 * mingw: fix building for ARM/AArch64 (Martin Storsjö)
 
 * unix: strnlen is not available on Solaris 10 (Claes Nästén)
 
 * sunos: restore use of event ports (Andy Fiddaman)
 
 * sunos,cmake: use thread-safe errno (Andy Fiddaman)
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEErq0KS2hnZ3UaDkrvNKJfsSgkZRQFAmD2OHUSHHZ0am5hc2hA
 Z21haWwuY29tAAoJEDSiX7EoJGUU6XsQAJqkq5qV54EEFQAIf/AV9e4pt5uua2iF
 bTyExNGyty5TW4OCytSxakLWS/9lN5vQo6/bjeUEfhq8a1BmLzJq5Nnmc8ntlYM6
 n89vZSRjgLNwQ2WuRV9akCMTPYydeJc6RboEjTDVlWtSr4QDCwK+fKgaMil+9uow
 Y8biEme/vIcpJNOE3IdhivUoS1Hl1PJrVbhJapHBQ6j4xf8CIrFBwn9qF0IX+Ngp
 9xZVvJFXQkZzqLqkHeMasGCp+hmQDnAiXKO3vbUJbeVwoCukDYmVG8Pb3H3RIyo9
 yZkdBpOZ1GEmnPY766IkArThM+/WBWTgz6pTOl59Zx0Wa5Dmr8ASUiauE/EEARS4
 v/QUQA13MS8cgOBhmPjrLQ9Kv6HPvLuZSjshEJz4RdL8aSThoQ7Om+AlR679wnyK
 vlcfNLoh+Jw1zCWKWO6c5BiqcB/8J/JPT2N0vMmT6+RZ8AiqyjGpBw+t1HeBkdW5
 CPJX06CXk7vsvCKbw4w8i8Xl40zm9yws5tO7ukG/lkmB5EUKhMe1z/5pTAWoFJV/
 srs6S+g3xmJ1oBeytjjEra/iJji/6jQ/oLbYeA+mvBxV5+hu7Mtnpzl0vWKrN5M2
 ewxOvJJtggT1V2WcVqYLmHdZpug+pspG6Uwm6/TG/379IFot3O4OjPZ8wlrLgaNt
 PU0FlUDCxyvT
 =gkXG
 -----END PGP SIGNATURE-----

Merge tag 'v1.42.0' into merge_1.42.0

PR-URL: https://github.com/libuv/libuv/pull/3245
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-07-23 13:32:16 -04:00
Claes Nästén
8ea8f12438
unix: strnlen is not available on Solaris 10
`strnlen` was not available on Solaris 10, so provide a fallback
implementation for it.

PR-URL: https://github.com/libuv/libuv/pull/3152
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-19 13:06:51 -04:00
tjarlama
caf22ddbf5
illumos: event ports to epoll
Sunos has added epoll wrappers to offer compatability for binaries
build specifically for linux (https://illumos.org/man/5/epoll). With
this, it's now possible to develop epoll as a generic interface and
share between Linux and SUNOS, similar to kqueue.

Fixes: https://github.com/libuv/libuv/issues/3008
PR-URL: https://github.com/libuv/libuv/pull/3046
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-07-02 15:00:37 -04:00
Ali Mohammad Pur
6b0051d14d
core: Correct the conditionals for {cloexec,nonblock}_ioctl
These functions are declared with one set of conditionals in the
header, and defined with another set of conditionals in the c file.
This commit makes all decisions regarding `uv__{nonblock,cloexec}_ioctl`
depend on a boolean macro instead.
There's one function that expects `uv__nonblock_ioctl` to be defined,
so that bit of the function is also conditionally compiled.

PR-URL: https://github.com/libuv/libuv/pull/3163
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-06-08 13:10:35 -04:00
David CARLIER
07b86b96c8
src: DragonFlyBSD has mmsghdr struct too
Still returns ENOSYS, until the send/recv functions are implemented.

PR-URL: https://github.com/libuv/libuv/pull/3040
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-28 11:18:22 -04:00
Ondřej Surý
c3fe3cf1bc
Make Thread Sanitizer aware of file descriptor close in uv__close()
Thread Sanitizer can't intercept syscall(SYS_close, fd) that's used
instead of close(fd); on Linux.  That leads to false positives as Thread
Sanitizer thinks the descriptor is still being used by the thread.

clang defines pre- and post- syscall actions, so wrap the close
syscall() into the action macros.  For gcc, use close() from glibc
instead of the syscall. This allows the thread sanitizer to intercept
closing of the file descriptor when libuv is compiled with Thread
Sanitizer.

PR-URL: https://github.com/libuv/libuv/pull/3112
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-04-04 17:52:26 +02:00
Brandon Cheng
054a495351
unix: expose thread_stack_size() internally
This function will be used by `uv__fsevents_loop_init` in a future
commit to determine the initial FSEvents pthread stack size.

PR-URL: https://github.com/libuv/libuv/pull/3132
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-04-04 17:32:57 +02:00
Jameson Nash
4ddc292774
stream: add uv_pipe and uv_socketpair to the API
Equivalents of `pipe` and `socketpair` for cross-platform use.

PR-URL: https://github.com/libuv/libuv/pull/2953
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2020-11-09 21:50:09 -05:00
Ben Noordhuis
05d4383daa
linux: fix i386 sendmmsg/recvmmsg support
Android/i386 doesn't have separate sendmmsg/recvmmsg system calls,
they're multiplexed through the socketcall system call.

(More precisely, the system calls may be present but the standard
seccomp filter rejects them, whereas socketcall is whitelisted.)

This commit removes the flags and timeout arguments from libuv's
internal system call wrappers because they're always zero and it
makes EINVAL/ENOSYS detection after a failed socketcall() easier.

Fixes: https://github.com/libuv/libuv/issues/2923
PR-URL: https://github.com/libuv/libuv/pull/2925
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-09-20 12:22:33 -04:00
Jameson Nash
dec0723864 2020.08.26, Version 1.39.0 (Stable)
Changes since version 1.38.1:
 
 * unix: use relaxed loads/stores for clock id (Ben Noordhuis)
 
 * build,win: link to user32.lib and advapi32.lib (George Zhao)
 
 * unix: squelch harmless valgrind warning (ssrlive)
 
 * include: fx c++ style comments warnings (Turbinya)
 
 * build,cmake: Change installation location on MinGW (erw7)
 
 * linux: use copy_file_range for uv_fs_copyfile when possible (Carter Li)
 
 * win,tcp: avoid reinserting a pending request (
 
 * docs: improve the descriptions for get memory info (Juan Sebastian velez
   Posada)
 
 * test: add udp-mmsg test (Ryan Liptak)
 
 * udp: add uv_udp_using_recvmmsg query (Ryan Liptak)
 
 * doc: add more error constants (TK-one)
 
 * zos: fix potential event loop stall (Trevor Norris)
 
 * include: add internal fields struct to uv_loop_t (Trevor Norris)
 
 * core: add API to measure event loop idle time (Trevor Norris)
 
 * win,fs: use CreateDirectoryW instead of _wmkdir (Mustafa M)
 
 * win,nfc: fix integer comparison signedness (escherstair)
 
 * win,nfc: use
 
 * win,nfc: removed some unused variables (escherstair)
 
 * win,nfc: add missing return statement (escherstair)
 
 * win,nfc: disable clang-format for
 
 * darwin: use IOKit for uv_cpu_info (Evan Lucas)
 
 * test: fix thread race in process_title_threadsafe (Ben Noordhuis)
 
 * win,fs: avoid implicit access to _doserrno (Jameson Nash)
 
 * test: give hrtime test a custom 20s timeout (Jameson Nash)
 
 * build: add more failed test, for qemu version bump (gengjiawen)
 
 * unix: handle src, dest same in uv_fs_copyfile() (cjihrig)
 
 * unix: error when uv_setup_args() is not called (Ryan Liptak)
 
 * aix: protect uv_exepath() from uv_set_process_title() (Richard Lau)
 
 * fs: clobber req->path on uv_fs_mkstemp() error (tjarlama)
 
 * cmake: fix compile error C2001 on Chinese Windows (司徒玟琅)
 
 * test: avoid double evaluation in ASSERT_BASE macro (tjarlama)
 
 * tcp: fail instantly if local port is unbound (Bartosz Sosnowski)
 
 * doc: fix most sphinx warnings (Jameson Nash)
 
 * nfci: address some style nits (Jameson Nash)
 
 * unix: don't use _POSIX_PATH_MAX (Ben Noordhuis)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIzBAABCgAdFiEElK42Z1xGTWS6+mjddDQ5C9vpucUFAl9EWmAACgkQdDQ5C9vp
 ucWLjxAAhKoJAz0z4MnTCn1wRss0QCIPQ+r7Be5QDbmLHW/z8maUy+WI0EO7TgKx
 4XHDgdEXel7/EtKFgfLMVx087WuwTT45Xx4W5yxLF1CgRsu3zyy/rLpX/aT4uEIj
 9QhZfY/s8H6LhJAyZwq/Km8UvG2Gbz01Y31aIXR6TdmBQ7MYr8JDu2KVYHMU0IZC
 pOju6C4JA09Z3PDtzxXAQj+xkzcWSgxkOTfRCmTbWcxsAhfUIse8zI84TW5STzGj
 7E0jq6hgdFimzVYX7WucfPtg1ugrnip84TgTrcVkrB7YIv1K72f0ZCtorrSBATAZ
 ZhbCY8vo+wRpPXTbNvtnPk05S3XYO+ImmGktZUl4lI0BzpmaXpAy2XRTYSylYJnB
 zSp4CtJnaG68ZxHf4/29+Fh/J6aesxalPaP0VJaSV1WWV9sMxRwzAix0CX5w8ZqI
 TwMdOiAYqQPw77jN08ED+teUROiPtodraqkSeORS/5W4Wr3QApOdXUKJz0VQ+mpm
 +J+I0wKyBbBiD/Pe/zrbW/182bfbZBa1HYpLMmGTov0gaLNup5pz1iNdVm8i9+KG
 3T9hSx+i36jbQ07MJG+UOunF3AqgUj7Sc5whrCVKcGpSThxN4dkSbMixGhBo86E1
 LcaqOEo6teIE+aZYm1lVUdLG7ZbygwH6FRnqyUHVWKumQsygCno=
 =tL0f
 -----END PGP SIGNATURE-----

Merge tag 'v1.39.0' into merge_1.39.0

PR-URL: https://github.com/libuv/libuv/pull/2969
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-08-27 11:37:05 -04:00
Ben Noordhuis
0e6e862049
unix: don't use _POSIX_PATH_MAX
Libuv was using _POSIX_PATH_MAX wrong. Bug introduced in commit b56d279b
("unix: do not require PATH_MAX to be defined") from September 2018.

_POSIX_PATH_MAX is the minimum max path size guaranteed by POSIX, not
the actual max path size of the system libuv runs on. _POSIX_PATH_MAX
is always 256, the real max is often much bigger.

This commit fixes buffer overruns when processing very long paths in
uv_fs_readlink() and uv_fs_realpath() because libuv was not allocating
enough memory to store the result.

Fixes: https://github.com/libuv/libuv/issues/2965
PR-URL: https://github.com/libuv/libuv/pull/2966
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-08-24 13:24:00 -04:00
Richard Lau
ea92e9c720
aix: protect uv_exepath() from uv_set_process_title()
Store a copy of the original argv[0] to protect `uv_exepath()`
against `uv_set_process_title()` changing the value of argv[0].

Extract common code for finding a program on the current PATH.

Fixes: https://github.com/libuv/libuv/issues/2674
PR-URL: https://github.com/libuv/libuv/pull/2677
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-08-10 11:27:30 -04:00
Jameson Nash
66720786d1 2020.07.04, Version 1.38.1 (Stable)
Changes since version 1.38.0:
 
 * test: use last matching qemu version (cjihrig)
 
 * win, util: rearrange uv_hrtime (Bartosz Sosnowski)
 
 * test: skip signal_multiple_loops test on QEMU (gengjiawen)
 
 * build: add android build to CI (gengjiawen)
 
 * test: extend fs_event_error_reporting timeout (cjihrig)
 
 * build: link libkvm on netbsd only (Alexander Tokmakov)
 
 * linux: refactor /proc file reader logic (Ben Noordhuis)
 
 * linux: read load average from /proc/loadavg (Ben Noordhuis)
 
 * android: remove patch code for below 21 (gengjiawen)
 
 * win: fix visual studio 2008 build (Arenoros)
 
 * win,tty: fix deadlock caused by inconsistent state (lander0s)
 
 * unix: use relaxed loads/stores for feature checks (Ben Noordhuis)
 
 * build: don't .gitignore m4/ax_pthread.m4 (Ben Noordhuis)
 
 * unix: fix gcc atomics feature check (Ben Noordhuis)
 
 * darwin: work around clock jumping back in time (Ben Noordhuis)
 
 * udp: fix write_queue cleanup on sendmmsg error (Santiago Gimeno)
 
 * src: build fix for Android (David Carlier)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIzBAABCgAdFiEElK42Z1xGTWS6+mjddDQ5C9vpucUFAl7/Yg8ACgkQdDQ5C9vp
 ucXgdg//euAx0jByjpOdc4RjLAXpq+iEDuLQXIzT3GmvK3g5+ymrB1HVkw455l7o
 gHY9f/GM+A8wZBcLoyfMywLiSD78/HOrHwQ1MGiieMm1hPFr8OXQ4Z25Bdx/GsE4
 2nCprDrfMrVUQs8eFVx30fjFvOymzhpHak173N6uBOVBLQRivQHSuOG4Dk7RJSAA
 iCIKQ6JulQ/yX0OFvvnYjwbnt5bCDlr1gTFX1HQZFi4dELIbdfaqn1AkY6COa4mc
 tKZRMC1rV81HejNAYFG2Js1QQaUKtMemyHUple6qRo/TYhsZXMaWShjOOHtBqT5X
 hQ8yqGLcaQhWXI7FlBK9aOFBc2/c7Jrxn78MFnd0C8kUHMT9oMhK3KOUHjJ4K5Zt
 sN06cS9Zj9Gpvcnzffohx6/0ePyIVHsEGBt8gRI3YCH4GR0A12WYc4Kr8YuJu11J
 7WVEjIpxZBRajOq8xfA4n6brM0s8gwJvCm2/ypYZKbQ0kz0ZZD5nOK+Ax+ukdg51
 cBtTyx0tme0bQPZkzJP5sMP6DqGKgHbMzeUueqJ5xXOuXWjnOZRWfxmT22RSc6vI
 9D+9p12GD81KlYoprbKk5Fg/adIW/kKrT1cFMeKgcKhyuq8B5maDoaN/FP0oIZc2
 p1Pv9KEJCo7gI35XwkEvEIDLJ1Ax8B8RQE+8sophzsxVxo5E+GE=
 =P+eq
 -----END PGP SIGNATURE-----

Merge tag 'v1.38.1' into merge_1.38.1

PR-URL: https://github.com/libuv/libuv/pull/2927
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-07-30 15:01:58 -04:00
Ben Noordhuis
72fe3543fe unix,win: add uv_library_shutdown()
Make it possible to explicitly tell libuv to release any resources
it's still holding onto (memory, threads, file descriptors, etc.)

Before this commit, cleanup was performed in various destructors.
This commit centralizes the cleanup logic, enabling the addition of
`uv_library_shutdown()`, but maintains the current observable behavior
of cleaning up when libuv is unloaded by means of `dlclose(3)`.

Fixes: https://github.com/libuv/libuv/issues/2763
PR-URL: https://github.com/libuv/libuv/pull/2764
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2020-04-22 12:24:36 +02:00
Marek Vavrusa
3d7136639a freebsd,linux: add recvmmsg() + sendmmsg() udp implementation
This commits adds support for recvmmsg() and sendmmsg() extensions to
recvmsg() and sendmsg() that allows the caller to receive and send
multiple message from a socket using a single system call. This has
performance benefits for some applications.

Co-authored-by: Ondřej Surý <ondrej@sury.org>
Co-authored-by: Witold Kręcicki <wpk@culm.net>

PR-URL: https://github.com/libuv/libuv/pull/2532
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2020-02-20 11:52:54 +01:00
Ben Noordhuis
233490819c freebsd,linux: simplify uv__make_pipe()
Assume the presence of the pipe2() system call. It was added
in FreeBSD 10 and Linux 2.6.27.

PR-URL: https://github.com/libuv/libuv/pull/2665
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2020-02-04 16:36:59 +01:00
Ben Noordhuis
ab6fc15a16 freebsd,linux: simplify uv__make_socketpair()
Assume the presence of the SOCK_CLOEXEC flag. It was added in FreeBSD 10
and before Linux 2.6.32.

PR-URL: https://github.com/libuv/libuv/pull/2665
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2020-02-04 16:36:59 +01:00
Jameson Nash
c39e0217aa 2020.01.24, Version 1.34.2 (Stable)
Changes since version 1.34.1:
 
 * misc: adjust stalebot deadlines (Jameson Nash)
 
 * test: fix env-vars flakiness (cjihrig)
 
 * test: avoid truncating output lines (Jameson Nash)
 
 * darwin: stop calling SetApplicationIsDaemon() (Ben Noordhuis)
 
 * ibmi: implement uv_interface_addresses() (Xu Meng)
 
 * osx,fsevent: fix race during uv_loop_close (Jameson Nash)
 
 * osx,fsevent: clear pointer when deleting it [NFCI] (Jameson Nash)
 
 * Revert "aix: replace ECONNRESET with EOF if already closed" (Jameson Nash)
 
 * unix: handle uv__open_cloexec return value correctly (Anna Henningsen)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIzBAABCgAdFiEElK42Z1xGTWS6+mjddDQ5C9vpucUFAl4pq5MACgkQdDQ5C9vp
 ucWJxA//fZm/u46gxSeRdWeFu9W1r1CgkJqmWT6vHeeBphk28lAulHAO0AM/bbbd
 x2WsLS8q7cLk3chwpN4CgJkgS8acqcsuHBGEzqc8o5cd76rCkua7eHvOR83D4Ix4
 c46hJH7WF3S4jnVV09iAU+mGplyUPF3F8HvmbTNZnbsuLKj2U88kDjm4nsxiSwdn
 aMeyZNtM6NdtqHRgIup+SqS4hNvaUt+gD7715efTlGPDwLR3KCJ8Mzd9F4JFrPrT
 wCjAGLiTFZXFcnwR/Ysx66jQNjfp/fZy7G/zU+7UFKwCjZdwZyybqzy4lmYXtV7N
 2hmliaxm3UsYPSD06mA+iUTdD9vnk2/htCNL5OBS11b6lAliYtdNC3l9BQ2Y3TVp
 xobPcjiRWmvN5P0GIL9/DjK7nxpSdj7BFFyyVz21/+OsYX+NYI4L/Vb4RjezGeGy
 RMS26S530fOsPCbPlSyEUqvjbTHI95FiLK8Y008YlRRsWVsCxrdrhDjT964LHZ51
 nFFPkR0Ghr/y0d9AzBsrsnjAi9g/K+dX3F72S8S2gS3LMkLVr6fLrEQ5AmclAa4f
 62TZvnKY3MzjdzsBpslGHHVp3l+HsNdkI27bLCbYUAL/c+R0fl96mac34IHGL+KV
 b/99O3WMxGtq/Zdn709ryMOLnC+F5KTJpl2LckExfxvubPcu9UQ=
 =SjB7
 -----END PGP SIGNATURE-----

Merge tag 'v1.34.2' into merge_1.34.2

PR-URL: https://github.com/libuv/libuv/pull/2649
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2020-01-31 13:34:36 -08:00
Ben Noordhuis
4ed2a78f0e unix,win: add uv_random()
Add an API for obtaining cryptographically strong random data from the
system PRNG.

Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
Refs: https://github.com/libuv/libuv/pull/1055
PR-URL: https://github.com/libuv/libuv/pull/2347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-09-18 08:09:14 +02:00
Ben Noordhuis
6e18112127 unix: make uv_cwd() report UV_ENOBUFS
Make uv_cwd() do what the documentation says it did when the destination
buffer is too small: report UV_ENOBUFS and set the `size` in/out param
to the size of the path including the trailing nul byte.

Fixes: https://github.com/libuv/libuv/issues/2333
PR-URL: https://github.com/libuv/libuv/pull/2335
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-06-20 12:04:16 +02:00
Jameson Nash
102a79fc20 2019.05.22, Version 1.29.1 (Stable)
Changes since version 1.29.0:
 
 * unix: simplify uv/posix.h include logic (cjihrig)
 
 * test: increase test timeout (cjihrig)
 
 * linux: fix sscanf() overflows reading from /proc (Ben Noordhuis)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIzBAABCgAdFiEElK42Z1xGTWS6+mjddDQ5C9vpucUFAlzkAM0ACgkQdDQ5C9vp
 ucXyuA/+NhzStMozgVJQ6lYjIjFQX4brTRr94r/fD46IVm0zHmXSh9qhxX8CVRSq
 u+aw4NfL1O+QYH3GObYB2fn/zDWmw0wOvBdIj96esVUSxvXHQt4xuugO8WcBx9QN
 d8hVfmLE8SQotOCAvHeW5RJJj0Xj9XMHtlRecMZfWCXnGntoGMVGLKyy0b+mfA5w
 Z7qxQ5odSi5b18qabiqrLG+NSZTNbozDWcfvkdUeJtmkBSqJNIZIkTjzXDTAyw41
 DJKqmC2zn4Y95diK8z6ayW/FIYtogG75rKZSMDwkHyXEG1+SQ3MFDQBYOdnic/0b
 pMip31nHEn4NZT2JUPi3A3gvlZXtYrm5VxCVRDgMv+I9UQj2EBBfaWASZhtQ0KSh
 UvaBsyuDIHsgGoJUFvrzVx9EjUmFnLl2UIlukNcWL4QiV1bJDpd4VppIsfXUCiud
 UlGc7EEzCgAzxgiG+FTMOpQrDqgjyShJdoEpjzKroVi4DDmWBQoQVkZM3bGdiEOD
 3DXVTfsHrXTkLPC55xqtwAb1Rgyi3mPhSrfHroaPG9gjNrcy9mPHEm5aiIiJ+3gH
 nunWCgMauJgZzBTPYc1+fwpuRkGb7OmPwgsuqYo2B0uZ/nJ5cy9lmuyqCW6u+Ua6
 Nxa2PEoaDeyWvkIOd7sCn+FeeQ2eLcueGLAaGtQdVCano4dmg/c=
 =mp2y
 -----END PGP SIGNATURE-----

Merge tag 'v1.29.1' into merge_1.29.1

PR-URL: https://github.com/libuv/libuv/pull/2316
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-06-07 14:22:16 -04:00
Ben Noordhuis
9063c27f92
darwin: fix thread cancellation fd leak
The close() system call tests for thread cancellation first. That has
the unfortunate side effect of aborting the sytem call with EINTR
without actually closing the file descriptor when the thread is in
the "cancel" state. Work around that by calling close$NOCANCEL().

This might well qualify as an academic bug because approximately no one
uses thread cancellation but let's aim for correctness anyway.

PR-URL: https://github.com/libuv/libuv/pull/2291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-05-15 12:18:57 -04:00