The cygwin runtime library fails to connect a socket client to a
listening server within the same thread. Test cases that use
this approach hang while waiting for the connection to complete.
This can be reproduced independent of libuv in a simple example
using both socket/bind/listen and socket/connect in a single
thread.
Avoid this problem in our test suite by skipping such tests on cygwin.
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 Cygwin `recvmsg` always sets `msg_controllen` to zero on a
message received from a named pipe. Therefore we cannot use
`sendmsg` to send handles for ipc. Return failure early from
this code path as `ENOSYS`.
Skip tests requiring this feature since it is not available.
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 Cygwin a `connect` to a file that is not a socket fails
with `EBADF` instead of `ENOTSOCK` even though the former is
supposed to be for a bad socket fd. Translate the error.
This fixes the `pipe_connect_to_file` to file test.
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 Cygwin a named pipe closed by terminating a child process
may be reported via `ECONNRESET` on the next read. Teach
`uv__read` to interpret this as end of file.
This fixes the `spawn_and_kill_with_std` test.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@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>
POSIX defines `poll()` as a portable way to wait on file descriptors.
Use it to provide an implementation of our poll abstraction for use
on platforms that do not provide a more specialized polling method.
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 platforms not supporting fsevents do not run the fork
fsevent tests.
PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Factor out a dedicated test macro for use on platforms that
do not support fsevents instead of duplicating the os390
platform condition and explanation text.
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>
It was previously assumed that OOB data had to be
inlined but that is incorrect.
PR-URL: https://github.com/libuv/libuv/pull/1347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
A small timeout resulted in flaky behaviour on the z/OS test
machine.
PR-URL: https://github.com/libuv/libuv/pull/1353
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Delay the timer start to be sure all handles are created when `timer_cb`
is executed. In some cases this was not the case causing the following
error:
```
not ok 51 - tcp_write_queue_order
exit code 134
Output from process `tcp_write_queue_order`:
lt-run-tests: src/unix/core.c:166: uv_close: Assertion `0' failed.
```
PR-URL: https://github.com/libuv/libuv/pull/1338
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Andrius Bentkus <andrius.bentkus@gmail.com>
Remove the kvm.h include since 38323c9fb replaced the use of kvm_open()
with sysctl(),
Conditionally check for kvm_open() on non-OpenBSD platforms so LIBS (and
libuv.pc) does not unnecessarily contain "-lkvm".
Fixes: https://github.com/libuv/libuv/issues/1340
PR-URL: https://github.com/libuv/libuv/pull/1344
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Basic implementation of uv__io_fork on z/OS.
As of now, since filesystem events are not supported,
skip all of those tests on z/OS.
PR-URL: https://github.com/libuv/libuv/pull/1303
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit fixes the following warning:
warning C4047: char *' differs in levels of indirection from 'char
(*)[1]'
PR-URL: https://github.com/libuv/libuv/pull/1290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
__declspec(inline) is completely undocumented, as well
as unnecessary. The INLINE preprocessor macro is used
throughout libuv, so this simply replaces the only instance
of declspec(inline) with the macro version.
PR-URL: https://github.com/libuv/libuv/pull/1307
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fix a bug in process_copy_output that would cause output larger
than 1kb to be incorrectly split into lines.
PR-URL: https://github.com/libuv/libuv/pull/1325
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Now that RHEL/CentOS 5 is end-of-life, update the baseline from
linux >= 2.6.18 + glibc >= 2.5 to linux >= 2.6.32 + glibc >= 2.12.
PR-URL: https://github.com/libuv/libuv/pull/1324
Refs: https://github.com/nodejs/node/pull/12672
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
We use guide.rst as our index, so there is no need for a secondary one.
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This is a fresh import of uvbook [0], as is. It is to be considered
"beta", as the entire content hasn't been revised / adapted yet.
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
`int epoll_init()` declares a function that takes any number of
arguments, use `int epoll_init(void)` instead.
PR-URL: https://github.com/libuv/libuv/pull/1314
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: John Barboza <jbarboza@ca.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Test that the fast path will continue writing. On failure, this test
will timeout.
PR-URL: https://github.com/libuv/libuv/pull/1308
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
"Fast" path in `uv_udp_send()` attempts to write the data straight away
without queueing the fd with epoll/kqueue/... However, in some cases
this is not possible when `sendmsg()` returns `EAGAIN`. In such event
libuv has to queue the fd anyway.
PR-URL: https://github.com/libuv/libuv/pull/1308
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Mea culpa, I forgot to update the documentation in commit ff0ae10
("unix: preserve loop->data across loop init/done") from July 2016.
PR-URL: https://github.com/libuv/libuv/pull/1299
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>