Commit Graph

4148 Commits

Author SHA1 Message Date
elephantp
9241cc2977
unix: fix uv_cpu_info() error on FreeBSD
This commit updates the key used in uv_cpu_info()
for ARM FreeBSD.

Fixes: https://github.com/nodejs/node/issues/17995
Fixes: https://github.com/libuv/libuv/issues/1694
PR-URL: https://github.com/libuv/libuv/pull/1700
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-01-17 09:44:30 -05:00
Ben Noordhuis
15f29dc08f
win: use RemoveDirectoryW() instead of _wmrmdir()
Use RemoveDirectoryW() and remap ERROR_DIRECTORY from UV_ENOENT
to UV_ENOTDIR so that attempted removal of a non-directory produces
the right (and legible) error message.

Fixes: https://github.com/nodejs/node/issues/18014
PR-URL: https://github.com/libuv/libuv/pull/1698
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-01-17 09:40:19 -05:00
John Barboza
634bcc3164
zos,test: accept SIGKILL for flaky test
Sending a SIGTERM to a process that is still starting up kills it with
SIGKILL instead of SIGTERM.

PR-URL: https://github.com/libuv/libuv/pull/1709
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-17 09:35:44 -05:00
Bert Belder
dcd9b3cb27 win: allow directory symlinks to be created in a non-elevated context
PR-URL: https://github.com/libuv/libuv/pull/1706
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-01-16 09:52:15 -08:00
Bert Belder
685059bf79 win,build: do not build executable installer for dll
PR-URL: https://github.com/libuv/libuv/pull/1707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-01-16 09:38:42 -08:00
Ben Wijen
14bfc27e64
unix,fs: fix for potential partial reads/writes
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>
2018-01-10 17:14:53 +01:00
Brad King
52b8b9a8b9
unix: use SA_RESTART when setting our sighandler
BSD `signal(2)` semantics make some system calls (e.g. for `write`)
restartable when interrupted by a signal handler.  Use `SA_RESTART` to
enable these semantics everywhere that supports them.

This was done by libev back when we used it.  In addition to being
common practice, this is required by C++ stream libraries that interpret
`EINTR` as any other error, set `badbit`, and stop writing.  I've
observed this with `libstdc++` during a `std::cout.flush()` call
interrupted by `SIGCHLD`.

PR-URL: https://github.com/libuv/libuv/pull/1696
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-01-10 14:42:10 +01:00
Ben Noordhuis
a468257e5d test: allow net unreachable status in udp test
Since the destination address may not be routable, UV_ENETUNREACH is
an error that can happen and should be handled.

Fixes: https://github.com/libuv/libuv/issues/1680
PR-URL: https://github.com/libuv/libuv/pull/1695
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-01-09 15:09:46 +01:00
Jérémy Lal
3ad4dfad0c test: allow multicast not permitted status
PR-URL: https://github.com/libuv/libuv/pull/1689
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-01-09 14:32:35 +01:00
Ben Noordhuis
6ecd79eb6e test: remove custom timeout for thread test on ppc
The two minute timeout should not be necessary anymore after commit
aeaff5f0 ("test: lower number of tasks in threadpool test".)

PR-URL: https://github.com/libuv/libuv/pull/1681
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-01-09 14:28:56 +01:00
Ben Noordhuis
8156f15e82 build: install libuv.pc unconditionally
It was requested and I can't see a reason not to.

Fixes: https://github.com/libuv/libuv/issues/1684
PR-URL: https://github.com/libuv/libuv/pull/1685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-01-09 14:22:46 +01:00
Bartosz Sosnowski
2b32e77bb6 win: map 0.0.0.0 and :: addresses to localhost
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>
2017-12-28 10:42:11 +01:00
Bartosz Sosnowski
cde132631b doc: mark Windows 7 as Tier 1 support
PR-URL: https://github.com/libuv/libuv/pull/1682
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-12-28 10:22:04 +01:00
Jameson Nash
fd049399aa
unix,tcp: avoid marking server sockets connected
It shouldn't be setting READABLE and WRITABLE on the socket server,
since they aren't, and this could confuse the client.

PR-URL: https://github.com/libuv/libuv/pull/1655
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-12-20 22:17:52 +01:00
John Barboza
b01de7341f
zos: implement uv_fs_event* functions
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>
2017-12-15 11:04:16 +01:00
cjihrig
e771ede069
win: set _WIN32_WINNT to 0x0600
This updates the value to Windows Vista.

Fixes: https://github.com/libuv/libuv/issues/1671
PR-URL: https://github.com/libuv/libuv/pull/1675
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-12-08 11:46:00 -05:00
Bartosz Sosnowski
890eedaf59 win, process: uv_kill improvements
Maps pid 0 to the current process, simulating Linux kill sending signal
to the process group.

Adds detection of invalid signals. If the signum is invalid - below 0
or NSIG or above – UV_EINVAL will be returned instead of UV_ENOSYS.

PR-URL: https://github.com/libuv/libuv/pull/1642
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-07 14:00:05 +01:00
Bartosz Sosnowski
c73e73c874 test: add threadpool init/teardown test
Verify that quick setup and teardown of the threadpool doesn't cause
crashes or hangs.

PR-URL: https://github.com/libuv/libuv/pull/1639
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-12-06 23:47:38 +01:00
Ben Noordhuis
647fbc026e unix,win: wait for threads to start
It appears that, at least on Windows, the process terminates abnormally
when the program exits before the worker threads complete initializing.
Wait for the threads to spin up in `init_threads()` to avoid that.

PR-URL: https://github.com/libuv/libuv/pull/1662
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
2017-12-06 23:47:38 +01:00
Matt Harrison
8a6d1b32c5 unix: make get(set)_process_title MT-safe
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>
2017-12-02 12:06:34 +01:00
Anna Henningsen
0d6525acae core: add getter/setter functions for easier ABI compat
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>
2017-12-02 09:51:25 +01:00
cjihrig
c6b7e19f81
Now working on version 1.18.1 2017-11-30 21:15:46 -05:00
cjihrig
a78847f1b2
Add SHA to ChangeLog 2017-11-30 21:07:39 -05:00
cjihrig
1489c98b7f
2017.12.02, Version 1.18.0 (Stable)
Changes since version 1.17.0:

* aix: fix -Wmaybe-uninitialized warning (cjihrig)

* doc: remove note about SIGWINCH on Windows (Bartosz Sosnowski)

* Revert "unix,win: wait for threads to start" (Ben Noordhuis)

* unix,win: add uv_os_getpid() (Bartosz Sosnowski)

* unix: remove incorrect assertion in uv_shutdown() (Jameson Nash)

* doc: fix IRC URL in CONTRIBUTING.md (Matt Harrison)
2017-11-30 21:07:38 -05:00
Matt Harrison
dadad46d70
doc: fix IRC URL in CONTRIBUTING.md
PR-URL: https://github.com/libuv/libuv/pull/1647
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-11-30 20:22:59 -05:00
Jameson Nash
0e2814179c
unix: remove incorrect assertion in uv_shutdown()
It isn't necessary, and doesn't agree with the printed message.

PR-URL: https://github.com/libuv/libuv/pull/1620
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-30 20:14:21 -05:00
Bartosz Sosnowski
d708df110a
unix,win: add uv_os_getpid()
Adds a multi platform way to get current process id.

PR-URL: https://github.com/libuv/libuv/pull/1661
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-30 20:11:21 -05:00
Ben Noordhuis
49616e4e17 Revert "unix,win: wait for threads to start"
Reverted for suspected regressions in the Node.js test suite on Windows.

Also revert e99ac4c1f4 ("test: add threadpool init/teardown test") since
it depends on 5486f6bd51.

This reverts commit 5486f6bd51.
This reverts commit e99ac4c1f4.

PR-URL: https://github.com/libuv/libuv/pull/1656
Refs: https://github.com/libuv/libuv/pull/1639
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-30 02:24:22 +01:00
Bartosz Sosnowski
c845245e43 doc: remove note about SIGWINCH on Windows
SIGWINCH support was improved by
6ad1e81547

PR-URL: https://github.com/libuv/libuv/pull/1638
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-28 14:48:09 +01:00
cjihrig
9f70d39b5a
aix: fix -Wmaybe-uninitialized warning
PR-URL: https://github.com/libuv/libuv/pull/1650
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-27 21:33:07 -05:00
cjihrig
40a003b4e1
Now working on version 1.17.1 2017-11-23 20:36:59 -05:00
cjihrig
c2c5b856e8
Add SHA to ChangeLog 2017-11-23 20:29:13 -05:00
cjihrig
1344d2bb82
2017.11.25, Version 1.17.0 (Stable)
Changes since version 1.16.1:

* unix: avoid malloc() call in uv_spawn() (Ben Noordhuis)

* doc: clarify the description of uv_loop_alive() (Ed Schouten)

* win: map UV_FS_O_EXLOCK to a share mode of 0 (Joran Dirk Greef)

* win: fix build on case-sensitive file systems (Ben Noordhuis)

* win: fix test runner build with mingw64 (Ben Noordhuis)

* win: remove unused variable in test/test-fs.c (Ben Noordhuis)

* zos: add strnlen() implementation (jBarz)

* unix: keep track of bound sockets sent via spawn (jBarz)

* unix,win: wait for threads to start (Ben Noordhuis)

* test: add threadpool init/teardown test (Bartosz Sosnowski)

* test: avoid malloc() in threadpool test (Ben Noordhuis)

* test: lower number of tasks in threadpool test (Ben Noordhuis)

* win: issue memory barrier in uv_thread_join() (Ben Noordhuis)

* ibmi: add support for new platform (Xu Meng)

* test: fix test-spawn compilation (Bartosz Sosnowski)
2017-11-23 20:29:12 -05:00
Bartosz Sosnowski
c6cca31463 test: fix test-spawn compilation
Unbreaks libuv compilation on Windows.

PR-URL: https://github.com/libuv/libuv/pull/1641
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-22 20:43:02 +01:00
Xu Meng
bb3d093bbb ibmi: add support for new platform
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>
2017-11-22 12:18:04 +01:00
Ben Noordhuis
5070620777 win: issue memory barrier in uv_thread_join()
I'm 99% sure `WaitForSingleObject()` already issues a memory barrier for
thread objects but since I could find no mention of that on MSDN, let's
play it safe and do it ourselves, too.

PR-URL: https://github.com/libuv/libuv/pull/1634
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-20 20:59:33 +01:00
Ben Noordhuis
aeaff5f037 test: lower number of tasks in threadpool test
Reduce the task count from 2*16*16 to 2*4*4 (512 vs. 32) because several
people have reported that the test frequently times out on their system.

Fixes: https://github.com/libuv/libuv/issues/1471
PR-URL: https://github.com/libuv/libuv/pull/1634
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-20 20:59:28 +01:00
Ben Noordhuis
9594719e73 test: avoid malloc() in threadpool test
Stack-allocate the `uv_loop_t` instance, no reason to heap-allocate it.

PR-URL: https://github.com/libuv/libuv/pull/1634
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-20 20:59:15 +01:00
Bartosz Sosnowski
e99ac4c1f4 test: add threadpool init/teardown test
Verify that quick setup and teardown of the threadpool doesn't cause
crashes or hangs.

PR-URL: https://github.com/libuv/libuv/pull/1639
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-20 20:35:23 +01:00
Ben Noordhuis
5486f6bd51 unix,win: wait for threads to start
It appears that, at least on Windows, the process terminates abnormally
when the program exits before the worker threads complete initializing.
Wait for the threads to spin up in `init_threads()` to avoid that.

Refs: https://github.com/libuv/libuv/pull/1613#issuecomment-344958863
PR-URL: https://github.com/libuv/libuv/pull/1639
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-20 20:35:02 +01:00
John Barboza
c5dd2d4218
unix: keep track of bound sockets sent via spawn
We use the UV_HANDLE_BOUND flag to mark a socket as bound to a
port. We need to do this for sockets that are sent from another
process as well as sockets that created by the process itself.
First check if the port number is non-zero. If yes then mark
it as bound.

PR-URL: https://github.com/libuv/libuv/pull/1348
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-20 18:36:26 +01:00
John Barboza
88d716e126 zos: add strnlen() implementation
Add an implementation of strnlen() which is not provided by default.

PR-URL: https://github.com/libuv/libuv/pull/1631
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-18 13:14:08 +01:00
Ben Noordhuis
0b18f57be5 win: remove unused variable in test/test-fs.c
PR-URL: https://github.com/libuv/libuv/pull/1632
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-18 13:12:06 +01:00
Ben Noordhuis
fe3e635425 win: fix test runner build with mingw64
Include `<winioctl.h>` for the definition of `FSCTL_SET_REPARSE_POINT`
and define `ERROR_SYMLINK_NOT_SUPPORTED` if not already defined.

PR-URL: https://github.com/libuv/libuv/pull/1632
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-18 13:11:30 +01:00
Ben Noordhuis
facac20348 win: fix build on case-sensitive file systems
Cross-compiling with mingw64 was broken because the header files are
called `accctrl.h` and `aclapi.h` whereas libuv was trying to include
`AccCtrl.h` and `AclAPI.h`.

PR-URL: https://github.com/libuv/libuv/pull/1629
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-17 12:59:59 +01:00
Joran Dirk Greef
1c4de1916e win: map UV_FS_O_EXLOCK to a share mode of 0
This is necessary to enable writing past the MBR of a raw block device.

Fixes: https://github.com/libuv/libuv/issues/1605
PR-URL: https://github.com/libuv/libuv/pull/1613
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-11-16 15:14:52 +01:00
Ed Schouten
7ef23d9e85 doc: clarify the description of uv_loop_alive()
This function not only returns true if there are active handles or
requests. First of all, it also takes into account whether handles are
referenced. Second, handles that are being closed also contribute to
whether a loop is alive.

Fixes: https://github.com/libuv/libuv/issues/1592
PR-URL: https://github.com/libuv/libuv/pull/1594
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-15 13:59:34 +01:00
Ben Noordhuis
c1ff7cc6aa unix: avoid malloc() call in uv_spawn()
The stdio count for the new process is almost always a low number that
we can allocate on the stack instead of the heap.

PR-URL: https://github.com/libuv/libuv/pull/1626
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-15 13:49:33 +01:00
cjihrig
6973886ac8
Now working on version 1.16.2 2017-11-10 12:03:09 -05:00
cjihrig
31f8051512
Add SHA to ChangeLog 2017-11-10 11:49:43 -05:00