The fallback for systems that lack preadv() only filled the first
buffer.
This commit rectifies that to fill all (or at least as many as possible)
buffers.
Fixes: https://github.com/libuv/libuv/issues/2332
PR-URL: https://github.com/libuv/libuv/pull/2338
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
So far, for some (?) errors, `uv_try_write()` returns `EAGAIN`
regardless of the actual error, so `ECONNRESET` and `EPIPE` errors
can be swallowed here.
This commit changes `uv_try_write()` so that it prefers to return
the actual error it has seen.
PR-URL: https://github.com/libuv/libuv/pull/2321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit add support for Haiku, an open-source operating system
inspired by BeOS.
PR-URL: https://github.com/libuv/libuv/pull/2301
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
It was reported that uv_get_free_memory() and uv_get_total_memory()
report the wrong values inside an lxc container.
Libuv calls sysinfo(2) but that isn't intercepted by lxc. /proc/meminfo
however is because /proc is a FUSE fs inside the container.
This commit makes libuv try /proc/meminfo first and fall back to
sysinfo(2) in case /proc isn't mounted.
Fixes: https://github.com/libuv/libuv/issues/2249
PR-URL: https://github.com/libuv/libuv/pull/2258
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This undoes the changes commit 5234b1c4 ("build,sunos: better handling
of non-GCC compiler") makes to configure.ac and Makefile.am because they
break the build on the centos6 buildbots with the following error:
# <snip>
checking for _FILE_OFFSET_BITS value needed for large files... no
./configure: line 12957: syntax error near unexpected token `;'
./configure: line 12957: `; then'
Build step 'Execute shell' marked build as failure
Refs: https://github.com/libuv/libuv/pull/2200
PR-URL: https://github.com/libuv/libuv/pull/2234
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
PR-URL: https://github.com/libuv/libuv/pull/2221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
`AC_PROG_CC` sets the `GCC` shell variable, which is supposed to be
used to enable GCC-specific options. A `GCC` check is added to only
pass the pre-existing GCC-specific options when using GCC.
The `GCC` variable is passed as an `AM_CONDITIONAL` and is used in
`Makefile.am` is used to address the following:
- Only pass `-pthreads` on `SUNOS` when using GCC
- Only use `-Wno-long-long` when using GCC
With the above changes, the Solaris build is now fixed when using the
native Studio compiler along with the minor adjustments:
- Always pass `-D_REENTRANT` to get thread-safe `errno`
PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Commit baa81465a ("build: add compile for android arm64/x86/x86-64")
introduced a number of new android-configure scripts but didn't add
them to EXTRA_DIST in Makefile.am, causing `make dist` to fail.
This commit also removes checkspare.sh from EXTRA_DIST. I broke that
in commit a7a16219d ("unix: remove checksparse.sh") from last June.
Mea culpa!
Fixes: https://github.com/libuv/libuv/issues/2190
PR-URL: https://github.com/libuv/libuv/pull/2198
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add two new methods:
`uv_udp_connect()` to connect / disconnect an UDP handle.
`uv_udp_getpeername()` to get the remote peer address of a connected UDP
handle.
Modify `uv_udp_send()` and `uv_udp_try_send()` to accept a `NULL` `addr`
to send messages over an "UDP connection".
Refs: https://github.com/libuv/leps/pull/10
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA 2003 and some don't support i18n domain names at all.
This is a potential security issue because it means a domain name
might resolve differently depending on the system that libuv is
running on.
Fixes: https://github.com/libuv/libuv/issues/2028
PR-URL: https://github.com/libuv/libuv/pull/2046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Use `setproctitle()` in `FreeBSD` as in the other `BSD` flavours.
Move `uv_setup_args()`, `uv_set_process_title()` and `uv_get_process_title()` to
`bsd-proctitle.c` so it's used by the supported BSDs.
PR-URL: https://github.com/libuv/libuv/pull/2042
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* dissolve include/uv/pthread-barrier.h
* use libuv mutexes and condition variables, not pthreads's
* drive-by cleanup and simplification enabled by the first two items
PR-URL: https://github.com/libuv/libuv/pull/2019
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Merge src/unix/timer.c and src/win/timer.c into src/timer.c. This
changes the Windows implementation from a binary tree to a binary
heap for generally better performance.
PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MSYS2 + MinGW-w64 have good support for autoconf, that should be the
preferred way of building libuv under MinGW.
This is a cherry-pick of commit ee949df1cb from the master branch.
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Use the right file path and variable name for the posix.h header file.
Introduced when commit ce41af28 ("cygwin: include uv-posix.h header")
was merged from the v1.x branch, where it is the correct path, into
the master branch.
This is a cherry-pick of commit d0c2ad39 from the master branch.
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This is a cherry-pick of commit d010030ad5 from the master branch.
Conflicts:
Makefile.am
include/uv.h
include/uv/unix.h
libuv.nsi (deleted)
src/unix/pthread-barrier.c (deleted)
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Added a check in uv__fs_buf_iter to detect partial reads and writes.
Partial reads and writes are looped until all data has been processed.
PR-URL: https://github.com/libuv/libuv/pull/640
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
On Linux when connecting IP addresses 0.0.0.0 and :: are automatically
converted to localhost. This adds same functionality to Windows.
PR-URL: https://github.com/libuv/libuv/pull/1515
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit uses the Register File Interest feature on z/OS
to enable users to monitor file system events.
The poll call is used to check for file descriptors as well
as a message queue that z/OS will report file system events
on. The last item on the list used by poll will contain the
message queue id instead of a file descriptor.
Limitation:
Writes to a directory (that is, file creation and deletion)
do not generate a change message for a registered directory.
PR-URL: https://github.com/libuv/libuv/pull/1311
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Used a shared uv_mutex_t in unix implementations of these functions
to prevent simultaneous execution.
Fixes: https://github.com/libuv/libuv/issues/271
PR-URL: https://github.com/libuv/libuv/pull/1640
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Add getter/setter functions for the fields of public structs that
might be relevant to e.g. Node.js addons.
Through these methods, ABI compatibility for a subset of the ABI
is easier to achieve, since using them makes code independent
of the exact offsets of these fields.
The intended use case that prompted this are N-API addons for
Node.js, which look for more long-term ABI compatibility guarantees
than typical Node code. With these helper functions, using libuv
directly should no longer be an obstacle for such addons.
PR-URL: https://github.com/libuv/libuv/pull/1657
Refs: https://github.com/nodejs/node/issues/13512
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Support the IBM i platform.
- add a new file src/unix/ibmi.c
- extract the common functions from /src/unix/aix.c into aix-common.c
- update uv.gyp and include/uv-unix.h to enable the new file ibmi.c
PR-URL: https://github.com/libuv/libuv/pull/1601
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Adds new uv_pipe_chmod function which can be used to make the pipe
writable or readable by all users.
PR-URL: https://github.com/libuv/libuv/pull/1386
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Out-of-band TCP messages are used for TCP data
transmission outside (outband) the inbound TCP
data. These packets are sent with an
"urgent pointer", but previously discarded.
Additionally, when using (e)poll a POLLPRI is
triggered when an interrupt signal is received
on GPIO capable systems such as the Raspberry Pi.
PR-URL: https://github.com/libuv/libuv/pull/1040
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Cygwin and MSYS2 are POSIX layers implemented on top of Windows.
Use our POSIX `poll(2)` implementation of our poll abstraction.
For most other components we already have dedicated sources
implementing them in terms of APIs available on Cygwin or
providing non-implementations of components not supported.
This leaves only three components that need Cygwin-specific
implementations:
* uv_uptime: implement using sysinfo
* uv_resident_set_memory: add a placeholder returning UV_ENOSYS
* uv_cpu_info: add a placeholder returning UV_ENOSYS
Update our test suite to account for features not available
due to Cygwin platform limitations or our placeholders.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
On Linux we read `/proc/self/exe` for the path to the executable.
Factor out a dedicated source file to make this implementation
available for use on other platforms that support it.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
On Linux we use `sysinfo(2)` to look up the load average.
Factor out a dedicated source file to make this implementation
available for use on other platforms that support it.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
On Linux we use `sysinfo(2)` to look up available memory.
Factor out a dedicated source file to make this implementation
available for use on other platforms that support it.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
On os390 we implement no support for fsevents. Other platforms may not
support fsevents either, so provide a dedicated source file to use in
this case.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
On SunOS we implement no support for proctitle. Other platforms may not
support proctitle either, so provide a dedicated source file to use in
this case.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>