Commit Graph

184 Commits

Author SHA1 Message Date
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
Andrew Paprocki
f62240b2d1
sunos: disable __attribute__((unused))
The Studio compiler prints out a warning when this attribute is used
because it does not support it (at least as of the latest 12.6 version):
https://docs.oracle.com/cd/E77782_01/html/E77788/gjzke.html#scrolltoc

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:20:40 -04:00
Santiago Gimeno
d16897c493
unix: refactor getsockname/getpeername methods
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>
2019-03-16 12:05:23 -04:00
Jameson Nash
2d2af382ce fsevents: really watch files with fsevents on macos 10.7+
In the original PR, the ifdef conditional was reversed,
leading to the old code-path still being used.
This also reduces some of the redundancy in the conditional checks,
by factoring out the common test.
And fixes a divergence in functionality kFSEventsRenamed =>
kFSEventStreamEventFlagItemRenamed
And actually includes the part of the original PR to kqueue that enabled
watching files with fsevents!

Fixes: https://github.com/libuv/libuv/pull/387
PR-URL: https://github.com/libuv/libuv/pull/2082
Refs: https://github.com/libuv/libuv/pull/1572
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-01-04 13:14:10 -05:00
Jameson Nash
f4a06a095c 2018.11.14, Version 1.24.0 (Stable)
Changes since version 1.23.2:
 
 * unix: do not require PATH_MAX to be defined (Brad King)
 
 * win,doc: path encoding in uv_fs_XX is UTF-8 (hitesh)
 
 * unix: add missing link dependency on kFreeBSD (Svante Signell)
 
 * unix: add support for GNU/Hurd (Samuel Thibault)
 
 * test: avoid memory leak for test_output (Carlo Marcelo Arenas Belón)
 
 * zos: avoid UB with NULL pointer arithmetic (Carlo Marcelo Arenas Belón)
 
 * doc: add vtjnash to maintainers (Jameson Nash)
 
 * unix: restore skipping of phys_addr copy (cjihrig)
 
 * unix,win: make uv_interface_addresses() consistent (cjihrig)
 
 * unix: remove unnecessary linebreaks (cjihrig)
 
 * unix,win: handle zero-sized allocations uniformly (Ben Noordhuis)
 
 * unix: remove unused uv__dup() function (Ben Noordhuis)
 
 * core,bsd: refactor process_title functions (Santiago Gimeno)
 
 * win: Redefine NSIG to consider SIGWINCH (Jeremy Studer)
 
 * test: make sure that reading a directory fails (Sakthipriyan Vairamani)
 
 * win, tty: remove zero-size read callbacks (Bartosz Sosnowski)
 
 * test: fix test runner getenv async-signal-safety (Ben Noordhuis)
 
 * test: fix test runner execvp async-signal-safety (Ben Noordhuis)
 
 * test,unix: fix race in test runner (Ben Noordhuis)
 
 * unix,win: support IDNA 2008 in uv_getaddrinfo() (Ben Noordhuis)
 
 * win, tcp: avoid starving the loop (Bartosz Sosnowski)
 
 * win, dl: proper error messages on some systems (Bartosz Sosnowski)
 
 * win,fs: retry if uv_fs_rename fails (Bartosz Sosnowski)
 
 * darwin: speed up uv_set_process_title() (Ben Noordhuis)
 
 * aix: fix race in uv_get_process_title() (Gireesh Punathil)
 
 * win: support more fine-grained windows hiding (Bartosz Sosnowski)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIzBAABCgAdFiEElK42Z1xGTWS6+mjddDQ5C9vpucUFAlvqWTsACgkQdDQ5C9vp
 ucX3ug//b4BUrqkohyhH5bjTbdlk4GVLJYhDYS2ZVUbHnBpcn7HkMiA2iJIcUUXh
 W/unU/g4pTUPfe42zhW3Lpy+AXSxeU/L2I9UaR5zTrzurCb821lGN25+gEjJOiQs
 WmuOQ9nj18EfF/XpNZIpq63eXHtL9nuNqJYf5EvRa3h10KyayBcNYFoJNupWIW+a
 a1sH+JiqMXInoXymsf9gCNm2IrqIpRV8PivPOVuWFQ6cqrTRmzyQD2AzCT+Op3s8
 PE+MW2mZGbCzBMjfvzvzoXZqPqy0ESEDsi39+Q+O7B58prTIiIEXZS1fvNSLmqLR
 oFfwRTPJonylmbuRgbxtkrwVAmsbV7ZAN+Nxcz5G8lq7eLvUErlwP2k7EryQQK31
 iCx2ld33UU8madcl3G8T4ksxusPUyHUdjE64MOtqNT1bnI2CAm/4lY7XL3jiT0Nr
 NahA/HvSEqA+EpdnlVWLasSgbgVWu5sbu8q+a8jHxFLhfDj526aPGRLqW5aMn/8O
 hzNXwO3BMS422ToVZMu0MFp5e3np20NR5mCsCWTkEQvryKQ1rbchlme4gagxGCfE
 zxKB4Qg3BaciHlilz732aUKaqFm8aR5jlqqCOS5WnkjBPXbdER8/kROf01e9IbQx
 NcnvEDOxZJBo4Q7F7OecDi85MPjIuFrBAXLM7BBj1gXbbyG22fU=
 =65Oa
 -----END PGP SIGNATURE-----

Merge tag 'v1.24.0' into merge_1.24.0

PR-URL: https://github.com/libuv/libuv/pull/2075
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-19 16:08:51 -05:00
Ben Noordhuis
fab6e64b39 unix: remove unused uv__dup() function
It was introduced in commit abdc3efffe ("unix: add uv__dup()") from
January 2012 to break ground for commit e34dc13496 ("unix: implement
uv_import() and uv_export()").

Those APIs were removed not much later but I forgot to remove the
helper function as well. Better late than never, eh?

PR-URL: https://github.com/libuv/libuv/pull/2043
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-17 20:26:03 +02:00
Santiago Gimeno
bf6c5be84d unix: refactor getsockname/getpeername methods
PR-URL: https://github.com/libuv/libuv/pull/1872
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-09-28 22:19:11 +02:00
Santiago Gimeno
6e7da5fbc0 2018.08.18, Version 1.23.0 (Stable)
Changes since version 1.22.0:
 
 * win,pipe: restore compatibility with the old IPC framing protocol (Bert
   Belder)
 
 * fs: add uv_open_osfhandle (Bartosz Sosnowski)
 
 * doc: update Visual C++ Build Tools URL (Michał Kozakiewicz)
 
 * unix: loop starvation on successful write complete (jBarz)
 
 * win: add uv__getnameinfo_work() error handling (A. Hauptmann)
 
 * win: return UV_ENOMEM from uv_loop_init() (cjihrig)
 
 * unix,win: add uv_os_{get,set}priority() (cjihrig)
 
 * test: fix warning in test-tcp-open (Santiago Gimeno)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIzBAABCgAdFiEElK42Z1xGTWS6+mjddDQ5C9vpucUFAlt2LW8ACgkQdDQ5C9vp
 ucXlDBAAlCVoa6GZthYy7fOBddNn2410GVKNZTUwNZ+bZL6ctpFxhgoH/Vir2SVg
 /8Je+Se3jz6QXJx0cA2+gLZdZ+nmZn4cAOGo9p6pWq2SVhmtc7F89KkHc8DDG0GR
 yGF09utyM4fQL0pnDYLzg66iquQJPCd1BwP32LlHOM0kqDyqli+OVphw/X9ABeHl
 GFPMD8i8wuHAKcOQo7xLsIETZVax/LC6N7seeMxO2ZIdAZFSeBw4OEyHra9hLq2r
 eleTccsA5R+tZZE9gUyefZ4s0desZkfndC0iL3qoWaM+TVxwpuB379BquDwhVwC1
 CFaFv7HLikNjUgwTSz9nUbsqxni2z+QH5gmgaF7WWpPIJcSf3ZH4T8wW9abRwizR
 BIehRtVHEM+TmC3Hr1ttfnDjMoFtyO33Tw1lSpQ9vlhll+sotei8RP7+oPumjlAN
 rs6dfnZ2FTxjNDWG1yaDXxoh2GWwR9gbxr/SiL/ZhoNHukJNN+gPAamF11S3Sk0v
 +h+iC9dtdiOPPWipxCZ+xeB3Tdus5Z+HVgG7Se859nt1r0kwA5zKfGw9pv65La9g
 KZuTCZjgvx7fCh4Mcw+uVExJ1vTWy+x5kOKk4l62RQj+L9f1YJZxgljMrBQTG9AU
 s4hMGI4gDMblyVM35T3vHModFBvwY0Uy90hn/yBCNILGbznNmD0=
 =Uf50
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEYS8OrZQBYiN530QC8ow8jaM8A74FAlt/3vUACgkQ8ow8jaM8
 A76jzQ//fAIPMjf42ifdQhD3/EFskQ9AwdiPLmDALUM9qn5hzfGp6XZ/XJKq87kg
 i2tm9wqh8m+QknSbnRkZMjDQrpmQuOypS+mqBDTVuPHHJ5V53f0zgStqlZ2dE5h9
 B/5YcGTukVjK6BIlazFH5QO8urc9IsYefSvPp9gepO1XnLCzkE9OpVgL9jFTLcaG
 Yvovtkbm4tkdYlOYZEp8LitnocRH84eJCZZipA3cfwctaWShKjPL6i/vB6TsmyH2
 7QSdKcBkbYJ50r03gUSRYNQYpoJDJEg7eht/XGPVbUGMhcZ53oz6DqGE+bqalZ5P
 VbD76KC96tqDhW99nCUij/RdT4Xo7NbK2+RiMXznr2H3KkpIt3eKEdD62B3ax1Hc
 cNzk/fINareTe/6gPVg08A8Tzpsg48PNnLpGkzYpHghCn2XBR1iTtQNpIOa1UpxO
 Gqe+uEP8k08tQ/n9rpBzBnNsC+fCZQU6Q5LGpWnTXMRjNtQuWM99O9k06TBPmDWI
 AQyJ9MByEt5bwNqsIg9nVe+iXkxNbZBOLHmqbkDUWNTDhjY3+oVh8Dq/18nvfgMk
 dIIBrBa0FEGbG/r/uKpuMqNmxCQel8nkC0sQ5vdIN8CfzAfQnoMww93GyPEpQTSR
 FAwdk7ri+mGcGw3igUp8IsgAKwgjJAkkWzAX3gAwHrw1aoUnc60=
 =3idK
 -----END PGP SIGNATURE-----

Merge tag 'v1.23.0' into merge_1.23.0

PR-URL: https://github.com/libuv/libuv/pull/1952
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-08-24 12:33:18 +02:00
Ben Noordhuis
619937c783 unix,win: merge handle flags
Some long overdue refactoring that unifies more of the UNIX and Windows
backends.

PR-URL: https://github.com/libuv/libuv/pull/1904
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-06-29 22:24:52 +02:00
Ben Noordhuis
95c5bf8db1 unix,win: merge timers implementation
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>
2018-06-25 23:48:15 +02:00
Ben Noordhuis
2256be01b0 unix: catch some cases of watching fd twice
Libuv does not support multiple handles watching the same file
descriptor.  That condition is caught by an assert but it's detached
from the call site and therefore not always trivial to track down.

This commit turns cases where we can easily detect duplicates into
runtime `UV_EEXIST` errors.  More work is needed to catch _all_ cases.

Partially addresses https://github.com/libuv/libuv/issues/1172.

PR-URL: https://github.com/libuv/libuv/pull/1851
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-05-30 13:24:19 +02:00
Ben Noordhuis
bf605bd7d0 linux: don't use uv__nonblock_ioctl() on sparc
uv__nonblock_fcntl() and uv__nonblock_ioctl() do not commute when
O_NDELAY is not equal to O_NONBLOCK.  Case in point: linux/sparc32
and linux/sparc64, where O_NDELAY is O_NONBLOCK + another bit.

Libuv uses uv__nonblock_fcntl() directly sometimes so ensure that it
commutes with uv__nonblock().

Fixes: https://github.com/libuv/libuv/issues/1830
PR-URL: https://github.com/libuv/libuv/pull/1832
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-05-06 23:48:02 +02:00
Michael Kilburn
9ed3ed5fcb
unix: fix several instances of lost errno
This commit preserves errno properly in the following cases:

- new_socket() was previously discarding errno in some cases,
  and replacing it with the result of getsockname().
- uv__close() was not preserving errno when __MVS__ is defined.

Fixes: https://github.com/libuv/libuv/issues/1756
PR-URL: https://github.com/libuv/libuv/pull/1763
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-03 11:03:41 -05:00
Santiago Gimeno
f94282c7ab 2018.02.22, Version 1.19.2 (Stable)
Changes since version 1.19.1:
 
 * test: fix incorrect asserts (cjihrig)
 
 * test: fix a typo in test-fork.c (Felix Yan)
 
 * build: remove long-obsolete gyp workarounds (Ben Noordhuis)
 
 * build: split off tests into separate gyp file (Ben Noordhuis)
 
 * test: check uv_cond_timedwait more carefully (Jamie Davis)
 
 * include,src: introduce UV__ERR() macro (Mason X)
 
 * build: add url field to libuv.pc (Ben Noordhuis)
 
 * doc: mark IBM i as Tier 3 support (Jesse Gorzinski)
 
 * win,build: correct C2059 errors (Michael Fero)
 
 * zos: fix timeout for condition variable (jBarz)
 
 * win: CREATE_NO_WINDOW when stdio is not inherited (Nick Logan)
 
 * build: fix commmon.gypi comment (Ryuichi KAWAMATA)
 
 * doc: document uv_timer_start() on an active timer (Vladimír Čunát)
 
 * doc: add note about handle movability (Bartosz Sosnowski)
 
 * doc: fix syntax error in loop documentation (Bartosz Sosnowski)
 
 * osx,stream: retry sending handle on EMSGSIZE error (Santiago Gimeno)
 
 * unix: delay fs req register until after validation (cjihrig)
 
 * test: add tests for bad inputs (Joyee Cheung)
 
 * unix,win: ensure req->bufs is freed (cjihrig)
 
 * test: add additional fs memory management checks (cjihrig)
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQIcBAABCgAGBQJajdXDAAoJEHQ0OQvb6bnF+gkQAIYnk1ujKETakcu/O8M/d+yu
 gZkLAnqkMYD5X5rTEFkaHrzrQMD85twxme+GgegSFweUDvhqVQWveeNG5zRJ8/ri
 HsysKioqBsMfzCtJw4W+wDLIL7ltja2vcZooTTyvrIArLd2zQ8sn0nHe/eTq2uKl
 wMPhup9qxl10THpevdab3AMr1jEJ3KSsFaNUaVLySf6DJJqY4pRV+ekDGQVrkNZU
 XzH67YN2XWP5dsavAVX0GsnQraX8kNWgYjcDK93D55hj93iyq+38ZYstEhNqIGF9
 9StzptoUyqK5KD5tyDYC2WmgwBJd9eAodmjCdq+ZP0td/irxEhQoRAX7aoAjBGzY
 j3vTb0JXhvvEghivap86mkxPhAQ6rmbGZkG/yOi6eexL/es1GwhGmfzE3NgUexCx
 nyKVCWqVo4IjL53+jndaX3wE4AIKpo0geah7f82v7cIJJqYN8DtaNN9imwZO3r7p
 WFUx2ujOYGuFcz1xbFNyLzBH0Rda2JnsvtAstGvWXSoXzCNSEU5PZ6rpn3jcOVU5
 mDjQ9z/x3kp25qp014+wxHD+mltZzcL8H8fJfQ9JkGWdYE+R3brzwib07GctdlKP
 3/PGH6vbDyiiCEiwfwjhjZpZWyJcaEuGegEc7J80uEm+/yq1/4HrdaFbI20D2heB
 NIj8XaaPt8Vqsafp0ZWp
 =Aa+M
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEYS8OrZQBYiN530QC8ow8jaM8A74FAlqRjUEACgkQ8ow8jaM8
 A77UBw//b71/tAhf1ZOEwouhCjuoy17PNrgfmpQFw8NbaJc6YALe2oQ+1+gc/GPp
 9kaPfjDLSlZwYJMVtiTmKaQoqYNj3Y6ZJatZYambZ89/3XCBjd4WbK2IMnpth+xU
 tLzvjd5RlNMNpyrdrlEXneZi5ql7/QeRLj85k2790LSSajODK8A4VoZZoRmfBL4S
 rnngc5BFI2MGNOyUcc4HBtAcusvt6KIZWxhiRHLa0vpNmrnUAcXqruxzp36+ct+3
 efy+9cx6uzbnqg7dv8WHljre+2we4NaHcH4W2zCkNuf0JrO9reJMjojBb3+NsVIt
 HBHonkVLvRf8eTv8VFoKQPqeMStVj2FtVRmuKqcZ8l/fZNH/Fz2R2tO2ZaLCrSax
 TkAiuLi7uOY32oBNNyI6GGwcJAD52ROl+UCBEoRCOpYVx6PWjZnun7zP7bYq+oJt
 h1qL7avrGfp7vG+ggDxfeEOlWZKeXBN6/uh+KnTFryxMwZ9GFNu46s2EttS2lATg
 eKvPXTPBF9xKVCxckDph5sBhT420SBt2xa8neeMMdEKXPaDPtyj9kMau6HeU84cO
 bcnGytFhlhx7qUv1sEO0gHp/fYkvdUYUhzsY5lWeVdz3U3j/YhQO+ErzBzhIOU+E
 arC+ldYO9eWzdgRxodOcHX6YFAEnHFeyXs5KfOKbUNdqD0dLNJQ=
 =lWVS
 -----END PGP SIGNATURE-----

Merge tag 'v1.19.2' into merge_1.19.2

PR-URL: https://github.com/libuv/libuv/pull/1753
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-02-24 17:04:48 +01:00
Mason X
89cbbc895b
include,src: introduce UV__ERR() macro
Using -errno, -E**, and -pthread_function() can be
error prone, and breaks compatibility with some operating
systems that already negate errno's (e.g. Haiku).

This commit adds a UV__ERR() macro that ensures libuv
errors are negative.

Fixes: https://github.com/libuv/help/issues/39
PR-URL: https://github.com/libuv/libuv/pull/1687
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-02-08 22:38:02 -05:00
Kamil Rytarowski
60bf1dfb51
netbsd: use uv__cloexec and uv__nonblock
This commit causes NetBSD, like other BSDs, to reuse
uv__cloexec_ioctl and uv__nonblock_ioctl. This fixes
poll_nested_kqueue.

PR-URL: https://github.com/libuv/libuv/pull/1575
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-10-02 09:27:38 -04:00
XadillaX
f1e0fc43d1 unix: fix wrong MAC of uv_interface_address
fix a wrong `if` in `uv_interface_address` about MAC.

Fixes: https://github.com/nodejs/node/issues/13581
PR-URL: https://github.com/libuv/libuv/pull/1375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-17 13:34:02 +02:00
CurlyMoo
d731fd1bd9 poll: add support for OOB TCP and GPIO interrupts
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>
2017-07-12 23:04:34 +02:00
Saúl Ibarra Corretgé
7043c79c2a Merge branch 'v1.x' into merge-v1 2017-07-09 13:52:50 +02:00
Ben Noordhuis
87df1448a4 unix,windows: refactor request init logic
Fixes a TODO in src/threadpool.c.  Updates the Windows code to drop the
unused `loop` parameter in calls to uv_req_init().

PR-URL: https://github.com/libuv/libuv/pull/1091
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-03-21 16:14:09 +01:00
Jason Madden
fd7ce57f2b unix: make loops and watchers usable after fork()
Added the uv_loop_fork() API that must be called in a child process to
continue using an existing loop. Internally this calls a uv__io_fork
function for each supported platform, similar to the way
uv__platform_loop_init works.

After this call, existing and new IO, async and signal watchers will
contiue working as before on all platforms, as will the
threadpool (although any threads it was using are of course gone).

On Linux and BSDs that use kqueue, existing and new fsevent watchers
will also continue to work as expected. On OS X, though, directory
fsevents will not be able to use the optimized CoreFoundation path if
they had already been used in the parent process, instead falling back
to the kqueue path used on other BSDs.

Existing fsevent watchers will not function on AIX or SunOS. This
could be relatively easily fixed by someone with AIX knowledge in the
future, but SunOS will require some additional work to keep track if
the watchers.

A new test file, test/test-fork.c, was added to contain fork-related
tests to verify functionality in the child process.

PR-URL: https://github.com/libuv/libuv/pull/846
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-03-21 12:23:44 +01:00
Ben Noordhuis
5fc8aecd81 unix: simplify async watcher dispatch logic
Remove the unused `nevents` parameter from `uv__async_event()`
and remove the indirection of having a separate `uv__async`
type.  There is only one instance per event loop these days.

This incidentally removes the `assert(n == sizeof(val))` in a
Linux-specific code path that some users seem to hit from time
to time.  The cause is not well-understood and I've never been
able to reproduce it myself.  Presumably libuv gets an EAGAIN
when trying to read from the eventfd but when and why that
happens is unclear.

Since the byte count is unused, removing the assert seems safe.
Worst case, libuv sometimes iterates over the async watcher list
when it doesn't have to.

Fixes: https://github.com/libuv/libuv/issues/1171
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Supersedes: https://github.com/libuv/libuv/pull/1214
2017-03-15 10:03:10 +01:00
Santiago Gimeno
c355c8b1a6
test: fix tests on OpenBSD
It fixes `process_title`, `poll_bad_fdtype` and `poll_nested_kqueue`
tests.

Fixes: https://github.com/libuv/libuv/issues/1216
PR-URL: https://github.com/libuv/libuv/pull/1218
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-02-07 17:47:17 +01:00
John Barboza
011e02e3e5 zos: make platform functional
Fix all functional test cases:

* use PLO compare,swap,store for atomic instruction
* do not use semaphore.h
* use xplink flag when linking
* scandir implementation
* nanosleep implementation
* add proctitle
* uv_loadavg
* uv_fs_event_init/start
* uv_fs_event_stop
* uv_exepath using __getthent syscall
* read free/total memory from mvs data areas
* uv_resident_set_memory implementation
* network interfaces implementation
* cpu_info implementation
* implement uv__hrtime
* make uv__fs_mkdtemp implementation
* epoll implementation for asyncio
* uv__fs_event_close implementation
* set process title
* read ancillary data that remains on queue
* ancillary data
* implement uv__fs_access
* use /dev/urandom for temporary directory name
* disable proctitle on zos completely

PR-URL: https://github.com/libuv/libuv/pull/1037
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-01-18 08:42:59 -06:00
Saúl Ibarra Corretgé
adedc27dfc Merge branch 'v1.x' into merge-v1 2017-01-17 22:01:39 -06:00
Brad King
6b35ca8616 unix: don't include CoreServices globally on macOS
In unix/internal.h, CoreServices is included for AvailabilityMacros.h.
This commit just includes AvailabilityMacros.h directly instead.

PR-URL: https://github.com/libuv/libuv/pull/1092
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-10-16 13:35:47 -04:00
Saúl Ibarra Corretgé
912d42b728 unix,win: unify timers implementation
PR-URL: https://github.com/libuv/libuv/pull/1058
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-09-23 09:32:31 +01:00
Saúl Ibarra Corretgé
d8baf7a6f8 Merge branch 'v1.x' 2016-09-20 00:24:14 +02:00
John Barboza
f4ef897666 zos: track unbound handles and bind before listen
On zOS the listen call does not bind automatically if the socket
is unbound. Hence the manual binding to an arbitrary port is
required to be done manually.

PR-URL: https://github.com/libuv/libuv/pull/949
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-08-24 10:02:41 +01:00
Jeffrey Clark
0a4b51fcb4 build: GNU/kFreeBSD support
autotools support only, gvp does not support kfreebsd detection.

PR-URL: https://github.com/libuv/libuv/pull/960
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-08-20 08:55:30 +02:00
Saúl Ibarra Corretgé
d527ab90f4 core: switch to C99
PR-URL: https://github.com/libuv/libuv/pull/994
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-08-12 23:10:34 +01:00
Saúl Ibarra Corretgé
3118e5a4e4 unix,win: share loop watchers implementation
PR-URL: https://github.com/libuv/libuv/pull/974
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-08-05 12:49:29 +01:00
Saúl Ibarra Corretgé
46dbdd0f97 macOS: drop support for macOS < 10.9
PR-URL: https://github.com/libuv/libuv/pull/966
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2016-08-04 12:01:08 +01:00
Ben Noordhuis
c5c419f7c8 unix: allow nesting of kqueue fds in uv_poll_start
kqueue file descriptors don't support ioctl(FIONBIO) (or any other ioctl
for that matter) so retry using fcntl(F_GETFL) + fcntl(F_SETFL) when we
receive a ENOTTY error.

Fixes: https://github.com/libuv/libuv/issues/883
PR-URL: https://github.com/libuv/libuv/pull/885
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-05-24 17:12:31 +02:00
Kári Tristan Helgason
f57bfd4dca unix: fix bug in barrier fallback implementation
There was a memory corruption issue with the pthread barrier
implementation on android, where a barrier could still be in use by one
thread when being freed by another.

This fixes that issue and adds lots of missing error handling.

This implementation is now also used for the OSX fallback.

Fixes: https://github.com/libuv/libuv/issues/615
PR-URL: https://github.com/libuv/libuv/pull/790
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-04-26 09:35:47 +02:00
Ben Noordhuis
375ba2d76d unix: use POLL{IN,OUT,etc} constants directly
Remove the UV__POLL defines and use POLL{IN,OUT,etc} directly.
On Linux, we lean on the fact that the POLL constants correspond
one-to-one to their EPOLL counterparts.

Fixes: https://github.com/libuv/libuv/issues/816
PR-URL: https://github.com/libuv/libuv/pull/817
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-04-11 10:51:13 +02:00
Santiago Gimeno
1c0281e3e2 process: fix uv_spawn edge-case
It can happen that the `parent` end of the `signal_pipe` is given a
STDIO file descriptor, so closing it using `uv__close` fails.

This problem is happening when running the `spawn_closed_process_io`
test in `SmartOS`. The reason being that when creating a socketpair in
`uv__process_init_stdio`, the `Illumos` implementation uses 3 sockets:
one is used as a listener, and the other 2 represent both ends of the
pipe. The listener socket is closed once the pipe is created. In the
test, the listener socket is assigned to the `0` fd, as it is the
first free fd in the system. So the fd `0` remained free after the call
to `socketpair`. Afterwards, when creating the `signal_pipe`, the fd `0`
is being assigned again, so closing it with `uv__close` made the test
fail. This issue is not happening in the other unixes because
`socketpair` doesn't use 3 fd's, but only 2.

To solve the issue, a new `uv__close__nocheckstdio()` function has been
added and used.

PR-URL: https://github.com/libuv/libuv/pull/796
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-31 11:53:42 +02:00
cjihrig
217f81b6a1 unix,win: add uv_get_passwd()
This commit adds the uv_get_passwd() function, which returns a
subset of the current effective user's password file entry.

Refs: https://github.com/libuv/libuv/issues/11
Fixes: https://github.com/libuv/libuv/issues/731
PR-URL: https://github.com/libuv/libuv/pull/742
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-29 08:13:59 -04:00
Ben Noordhuis
27aa81fe5a aix: fix 'POLLRDHUP undeclared' build error
AIX doesn't have POLLRDHUP.  Fixes the following compile-time error:

    src/unix/core.c: In function 'uv__io_start':
    src/unix/core.c:831:40: error: 'POLLRDHUP' undeclared
    assert(0 == (events & ~(UV__POLLIN | UV__POLLOUT | UV__POLLRDHUP)));

Fixes: https://github.com/libuv/libuv/issues/783
PR-URL: https://github.com/libuv/libuv/pull/785
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-03-26 11:31:23 +01:00
Santiago Gimeno
c7c8e916b8 poll: add UV_DISCONNECT event
It allows detecting the remote socket closing the connection. It's
emitted when `EPOLLRDHUP`(Linux), `EV_EOF`(BSD), `POLLRDHUP`(Solaris,
AIX) and `AFD_POLL_DISCONNECT`(Windows) events are received.

PR-URL: https://github.com/libuv/libuv/pull/691
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-15 23:39:49 +01:00
Kári Tristan Helgason
d7910e42d0 unix: add fork-safe open file function
PR-URL: https://github.com/libuv/libuv/pull/743
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-08 09:10:26 +01:00
Ben Noordhuis
a0b56059cf unix: report errors for unpollable fds
Libuv would abort() when trying to watch a file descriptor that is
not compatible with epoll-style polling; file descriptors referring
to on-disk files fall into this category.

File descriptors that libuv creates itself are not an issue but
external ones that come in through the uv_poll_init() API are.

Make uv_poll_init() check whether the file descriptor is accepted by
the underlying system call and return an error when it's not.

Fixes: https://github.com/libuv/libuv/issues/658
PR-URL: https://github.com/libuv/libuv/pull/659
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-01-21 17:57:00 +01:00
Saúl Ibarra Corretgé
01544d861b Revert "stream: squelch ECONNRESET error if already closed"
This reverts commit 05a003a3f7.

This commit triggerd "test-tls-hello-parser-failure" failure in io.js.
See the reference below for a more thorough explanation.

Refs: https://github.com/nodejs/io.js/pull/2310
PR-URL: https://github.com/libuv/libuv/pull/475
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-07 14:19:08 +02:00
ronkorving
2bf782777f unix: allow nbufs > IOV_MAX in uv_fs_{read,write}
This allows writing and reading any amount of buffers,
regardless of what IOV_MAX may be defined as.

It also moves the IOV_MAX test from stream to core.

This is based on the excellent work of @bwijen in #269.

Refs: https://github.com/libuv/libuv/pull/269
PR-URL: https://github.com/libuv/libuv/pull/448
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-08-04 11:31:04 +02:00
Santiago Gimeno
05a003a3f7 stream: squelch ECONNRESET error if already closed
Add new UV__POLLRDHUP event to be emitted when EPOLLRDHUP(in Linux) or
EV_EOF(in BSD / OSX) is detected and only if UV_READABLE is set.

When a read returns ECONNRESET after a UV__POLLRDHUP event, emit EOF instead
of the error.

Add tcp-squelch-connreset test. Not to be run on Windows as it returns
ECONNRESET error.

Fixes in test-poll and test-tcp-open so they pass after these changes.

PR-URL: https://github.com/libuv/libuv/pull/403
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-07-10 09:25:01 +02:00
Saúl Ibarra Corretgé
1816dbc85f unix: make sure UDP send callbacks are asynchronous
Fixes: https://github.com/libuv/libuv/issues/301
PR-URL: https://github.com/libuv/libuv/pull/371
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-28 11:05:45 +02:00