Commit Graph

4148 Commits

Author SHA1 Message Date
Bartosz Sosnowski
dc596109d5 doc: add bzoz to maintainers
PR-URL: https://github.com/libuv/libuv/pull/1358
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-25 17:51:45 +02:00
cjihrig
6c2fd34e39 doc: mark uv_loop_fork() as experimental
uv_loop_fork() was recently added, but is known to contain
bugs. This commit marks the function as experimental so that
bugs can be addressed without blocking further libuv releases.

Refs: https://github.com/libuv/libuv/pull/846
Refs: https://github.com/libuv/libuv/pull/1269
Refs: https://github.com/libuv/libuv/issues/1264
PR-URL: https://github.com/libuv/libuv/pull/1356
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-05-25 11:41:27 -04:00
Brad King
621655352c test: skip self-connecting tests on cygwin
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>
2017-05-21 16:12:30 +02:00
Brad King
580f032737 cygwin: disable non-functional ipc handle send
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>
2017-05-21 16:12:28 +02:00
Brad King
317fc756a5 cygwin: fix uv_pipe_connect report of ENOTSOCK
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>
2017-05-21 16:12:26 +02:00
Brad King
2e197418c3 cygwin: recognize EOF on named pipe closure
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>
2017-05-21 16:12:24 +02:00
Brad King
6398251aff cygwin: implement support for cygwin and msys2
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>
2017-05-21 16:12:21 +02:00
Brad King
c108137d7c unix: add a uv__io_poll impl using POSIX poll(2)
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>
2017-05-21 16:12:19 +02:00
Brad King
77326e86a2 unix: factor out reusable procfs exepath impl
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>
2017-05-21 16:12:18 +02:00
Brad King
76bcf9f91d unix: factor out reusable sysinfo loadavg impl
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>
2017-05-21 16:12:16 +02:00
Brad King
ea795b29ef unix: factor out reusable sysinfo memory lookup
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>
2017-05-21 16:12:14 +02:00
Brad King
32ef58bf72 unix: factor out reusable no-fsevents impl
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>
2017-05-21 16:12:11 +02:00
Brad King
773d678c6a test: skip fork fsevent cases when lacking support
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>
2017-05-21 16:12:09 +02:00
Brad King
f4f1f57e7c test: factor out fsevents skip explanation
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>
2017-05-21 16:12:08 +02:00
Brad King
470b0258b0 unix: factor out reusable no-proctitle impl
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>
2017-05-21 16:11:33 +02:00
Ben Noordhuis
6c2fe3d946 test: fix -Wstrict-prototypes compiler warnings
PR-URL: https://github.com/libuv/libuv/pull/1354
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-21 16:07:34 +02:00
John Barboza
ff360e7f14
zos: do not inline OOB data by default
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>
2017-05-19 12:14:08 +02:00
John Barboza
573e7fe8fc
zos: increase timeout for tcp_writealot
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>
2017-05-19 12:05:29 +02:00
cjihrig
d8cd08bd98 unix,win: add uv_os_gethostname()
Fixes: https://github.com/libuv/libuv/issues/1315
PR-URL: https://github.com/libuv/libuv/pull/1342
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-05-18 10:27:47 -04:00
Santiago Gimeno
4d0054145d
test: fix flaky tcp-write-queue-order
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>
2017-05-17 18:56:59 +02:00
James McCoy
22fc92856d
build,openbsd: remove kvm-related code
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>
2017-05-17 17:50:58 +02:00
cjihrig
1217832e6f unix: remove FSEventStreamFlushSync() call
This call, in the context of file watching, appears to trigger
assertion warnings on some macOS configurations.

Refs: https://github.com/nodejs/node/issues/854
Fixes: https://github.com/libuv/libuv/issues/1334
PR-URL: https://github.com/libuv/libuv/pull/1349
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-05-16 13:03:55 -04:00
Marc Schlaich
e11dcd4377 unix: do not close udp sockets on bind error
This makes Unix behave in the same way as Windows.

Fixes: https://github.com/libuv/libuv/issues/1336
PR-URL: https://github.com/libuv/libuv/pull/1337
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-09 15:51:26 -04:00
John Barboza
cb0cc7346d
zos: implement uv__io_fork, skip fs event tests
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>
2017-05-03 11:58:16 +02:00
Jameson Nash
fd39cec4b8
build: add -Wstrict-prototypes
Fixes: https://github.com/libuv/libuv/pull/1320
PR-URL: https://github.com/libuv/libuv/pull/1326
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-02 23:00:33 +02:00
Rasmus Christian Pedersen
51f3f56f34 test: fix VC++ compilation warning
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>
2017-05-01 14:44:28 -04:00
Keane
196eb8b94f win: remove __declspec(inline) from atomic op
__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>
2017-05-01 14:10:13 -04:00
Bartosz Sosnowski
bcf6202921 win,test: support stdout output larger than 1kb
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>
2017-05-01 12:52:23 -04:00
Jameson Nash
7350644939 win: avoid leaking pipe handles to child processes
Refs: https://github.com/joyent/libuv/issues/1313
PR-URL: https://github.com/libuv/libuv/pull/1321
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-01 12:27:13 -04:00
Ben Noordhuis
4e61013880 doc: update supported linux/glibc baseline
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>
2017-04-28 11:21:04 +02:00
Saúl Ibarra Corretgé
d59d6e6f22 doc: add code samples from uvbook (unadapted)
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:16:15 +02:00
Saúl Ibarra Corretgé
2ce5734d76 doc: remove ubvook reference from README
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:16:09 +02:00
Saúl Ibarra Corretgé
ed76c055cd doc: change license to CC BY 4.0
Text taken from:
https://creativecommons.org/licenses/by/4.0/legalcode.txt

Fixes: https://github.com/libuv/libuv/issues/1254
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:59 +02:00
Saúl Ibarra Corretgé
0227060489 doc: add warning note to user guide
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:53 +02:00
Saúl Ibarra Corretgé
481f454403 doc: remove licensing note from guide/about
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:47 +02:00
Saúl Ibarra Corretgé
1caae80cd6 doc: update guide/about and mention new maintainership
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:38 +02:00
Saúl Ibarra Corretgé
a94f83e4d8 doc: removed unused file
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>
2017-04-28 11:15:29 +02:00
Saúl Ibarra Corretgé
b80106de45 doc: add initial version of the User Guide
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>
2017-04-28 11:15:10 +02:00
Saúl Ibarra Corretgé
521146dac4 doc: move "upgrading" to a standalone document
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:04 +02:00
Saúl Ibarra Corretgé
afb37ce451 doc: move documentation section up
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:14:56 +02:00
Saúl Ibarra Corretgé
8e95cba175 doc: move TOC to a dedicated document
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:14:50 +02:00
Saúl Ibarra Corretgé
d2eca716f1 doc: update copyright years
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:14:39 +02:00
Saúl Ibarra Corretgé
93415e662b doc: rename docs to "libuv documentation"
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:13:39 +02:00
Ben Noordhuis
710989b087 zos: use proper prototype for epoll_init()
`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>
2017-04-25 17:15:26 +02:00
Daniel Kahn Gillmor
e4bc694b36 doc: fix documentation for uv_handle_t.type
PR-URL: https://github.com/libuv/libuv/pull/1316
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-04-25 08:15:11 +02:00
Trevor Norris
d898a1f6f8 test: add test for uv_udp_send() fix
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>
2017-04-20 18:10:43 -04:00
Fedor Indutny
0cbad54f18 udp: fix fast path in uv_udp_send() on unix
"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>
2017-04-20 18:10:43 -04:00
Ben Noordhuis
8fd1e40606 doc: add link to libuv/help to README
PR-URL: https://github.com/libuv/libuv/pull/1309
Refs: https://github.com/libuv/libuv/issues/1305
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-04-18 17:30:04 +02:00
Ben Noordhuis
b678fb6191 github: add ISSUE_TEMPLATE.md
Add a ISSUE_TEMPLATE that redirects people to libuv/help for questions.

PR-URL: https://github.com/libuv/libuv/pull/1309
Refs: https://github.com/libuv/libuv/issues/1305
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-04-18 17:29:59 +02:00
Ben Noordhuis
a76e7830ca doc: libuv does not touch uv_loop_t.data
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>
2017-04-18 10:42:23 +02:00