Commit Graph

927 Commits

Author SHA1 Message Date
cjihrig
8568f78a77
2018.07.11, Version 1.22.0 (Stable)
Changes since version 1.21.0:

* unix: remove checksparse.sh (Ben Noordhuis)

* win: fix mingw build error (Ben Noordhuis)

* win: fix -Wunused-function warnings in thread.c (Ben Noordhuis)

* unix,win: merge timers implementation (Ben Noordhuis)

* win: fix pointer type in pipe.c (Ben Noordhuis)

* win: fixing build for older MSVC compilers (Michael Fero)

* zos: clear poll events on every iteration (jBarz)

* zos: write-protect message queue (jBarz)

* zos: use correct pointer type in strnlen (jBarz)

* unix,win: merge handle flags (Ben Noordhuis)

* doc: update Imran Iqbal's GitHub handle (cjihrig)

* src: add new error apis to prevent memory leaks (Shelley Vohr)

* test: make test-condvar call uv_cond_wait (Jamie Davis)

* fs: change position of uv_fs_lchown (Ujjwal Sharma)
2018-07-09 22:04:47 -04:00
Ujjwal Sharma
4f43a8673b
fs: change position of uv_fs_lchown
Change the position of UV_LS_LCHOWN, moving it to the end in order to go
around a bug due to it's initial position.

The original position of UV_LS_LCHOWN broke ABI compat, causing a binary
using UV_FS_REALPATH or UV_FS_COPYFILE to break, as the values point to
wrong function.

Refs: https://github.com/yarnpkg/yarn/issues/6043
Fixes: https://github.com/libuv/libuv/issues/1908
PR-URL: https://github.com/libuv/libuv/pull/1913
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-07-07 15:48:44 +02:00
Shelley Vohr
5124b27d35
src: add new error apis to prevent memory leaks
This PR creates two new externally-facing APIs, uv_err_name_r() and
uv_strerror_r().

In keeping with the precedent set by POSIX, the *_r() suffix of these
two new methods indicate that the caller does the memory management and
passes in the memory that the output will be stored in, which provides
an alternative for the two existent methods (uv_err_name() and
uv_strerror()), which, when called with an unknown error code, leak a
few bytes of memory.

PR-URL: https://github.com/libuv/libuv/pull/1898
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno santiago.gimeno@gmail.com
2018-07-06 19:35:21 +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
cjihrig
07955ed373
Now working on version 1.21.1
Fixes: https://github.com/libuv/libuv/issues/1897
2018-06-22 11:07:12 -04:00
cjihrig
e4983a9b0c
2018.06.23, Version 1.21.0 (Stable)
Changes since version 1.20.3:

* unix,windows: map EFTYPE errno (cjihrig)

* win: perform case insensitive PATH= comparison (cjihrig)

* win, fs: uv_fs_fchmod support for -A files (Bartosz Sosnowski)

* src,lib: fix comments (Tobias Nießen)

* win,process: allow child pipe handles to be opened in overlapped mode
  (Björn Linse)

* src,test: fix idiosyncratic comment style (Bert Belder)

* test: fs_fchmod_archive_readonly must return a value (Bert Belder)

* win,pipe: fix incorrect error code returned from uv_pipe_write_impl()
  (Bert Belder)

* win,pipe: properly set uv_write_t.send_handle in uv_write2() (Bert
  Belder)

* test: add vectored uv_write() ping-pong tests (Bert Belder)

* win,pipe: support vectored uv_write() calls (Bert Belder)

* win,pipe: refactor pipe read cancellation logic (Bert Belder)

* test: improve output from IPC test helpers (Bert Belder)

* test: add test for IPC deadlock on Windows (

* win,pipe: fix IPC pipe deadlock (Bert Belder)

* unix: catch some cases of watching fd twice (Ben Noordhuis)

* test: use custom timeout for getaddrinfo_fail_sync (Ben Noordhuis)

* Revert "win: add Windows XP support to uv_if_indextoname()" (Bert
  Belder)

* win,thread: remove fallback uv_cond implementation (Bert Belder)

* src,test: s/olny/only (cjihrig)

* unix: close signal pipe fds on unload (Ben Noordhuis)

* win: allow setting udp socket options before bind (cjihrig)

* unix: return UV_ENOTSUP on FICLONE_FORCE failure (cjihrig)

* win,pipe: remove unreferenced local variable (Bert Belder)

* win,code: remove GetQueuedCompletionStatus-based poller (Bert Belder)

* win: remove the remaining dynamic kernel32 imports (Bert Belder)

* test: speedup process-title-threadsafe on macOS (cjihrig)

* core: move all include files except uv.h to uv/ (Saúl Ibarra Corretgé)

* win: move stdint-msvc2008.h to include/uv/ (Ben Noordhuis)

* build: fix cygwin install (Ben Noordhuis)

* build,win: remove MinGW Makefile (Saúl Ibarra Corretgé)

* build: add a cmake build file (Ben Noordhuis)

* build: add test suite option to cmake build (Ben Noordhuis)

* unix: set errno in uv_fs_copyfile() (cjihrig)

* samples: fix inconsistency in parse_opts vs usage (zyxwvu Shi)

* linux: handle exclusive POLLHUP with UV_DISCONNECT (Brad King)

* include: declare uv_cpu_times_s in higher scope (Peter Johnson)

* doc: add uv_fs_fsync() AIX limitations (jBarz)

* unix,win: add uv_fs_lchown() (Paolo Greppi)

* unix: disable clang variable length array warning (Peter Johnson)

* doc: document uv_pipe_t::ipc (Ed Schouten)

* doc: undocument uv_req_type's UV_REQ_TYPE_PRIVATE (Ed Schouten)

* doc: document UV_*_MAP() macros (Ed Schouten)

* win: remove use of min() macro in pipe.c (Peter Johnson)

* doc: add jbarz as maintainer (
2018-06-22 11:04:58 -04:00
Paolo Greppi
aa28f7d5bf
unix,win: add uv_fs_lchown()
Fixes: https://github.com/libuv/libuv/issues/1790
PR-URL: https://github.com/libuv/libuv/pull/1826
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-19 10:05:01 -04:00
Peter Johnson
02fc10918c
include: declare uv_cpu_times_s in higher scope
This fixes a C/C++ ambiguity about whether this structure is
scoped or global.

PR-URL: https://github.com/libuv/libuv/pull/1888
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-19 09:29:33 -04:00
Ben Noordhuis
47dcc07cf7 win: move stdint-msvc2008.h to include/uv/
Move it so that include/ contains uv.h and nothing more.

PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-14 18:40:09 +02:00
Saúl Ibarra Corretgé
99ae3edf28 core: move all include files except uv.h to uv/
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>
2018-06-14 18:39:32 +02:00
Bert Belder
13e8b15eb7
win,thread: remove fallback uv_cond implementation
The fallback implementation existed to support Windows XP and Server 2003,
but these old versions of windows are no longer supporter by libuv.

PR-URL: https://github.com/libuv/libuv/pull/1852
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-30 13:23:55 -07:00
Bert Belder
4e53af9120
win,pipe: fix IPC pipe deadlock
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: https://github.com/libuv/libuv/issues/1099
Refs: https://github.com/nodejs/node/issues/7657
Refs: https://github.com/electron/electron/issues/10107
Refs: https://github.com/parcel-bundler/parcel/issues/637
Refs: https://github.com/parcel-bundler/parcel/issues/900
Refs: https://github.com/parcel-bundler/parcel/issues/1137
PR-URL: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-05-29 13:02:22 -07:00
Bert Belder
4f60e0c1d7
win,pipe: refactor pipe read cancellation logic
* Don't silently ignore ERROR_OPERATION_ABORTED.

  Code to silently ignore this error was added in c42a4ca, under the
  false premise that this error is somehow equivalent to EINTR on posix
  platforms. This isn't true; ERROR_OPERATION_ABORTED doesn't happen
  unless the application explicitly aborts an I/O operation.

  Silently ignoring this error elsewhere could potentially hide bugs,
  hence libuv shouldn't do it. Instead, explicitly deal with it where
  it is expected.

* Don't mark aborted reads as successful.

  The worker thread used to call ReadFile() on synchronous pipes would
  incorrectly mark cancelled read requests as successful, leading to
  issues later on.

* Rely on main thread to restart aborted reads.

  After a blocking ReadFile() call was cancelled, the worker thread
  would previously attempt to restart it immediately, making
  synchronization logic needlessly complex. Instead, we simply cancel
  the operation, and leave it to the main loop to restart it if so
  desired.

  Since we now realy on the main thread to restart interrupted
  ReadFile() calls, we can now have a single function interrupts a
  synchronous read until the event loop restarts it again.

* Clean up uv__pipe_read_stop().

  A single function to interrupt blocking reads also allows us to
  remove weird logic in uv__pipe_read_stop() that quickly pauses and
  unpauses a read operation in the hope of cancelling it.

* Assume CancelIo() and CancelSynchronousIo() are always available.

  Since libuv doesn't support windows XP and Server 2003 any more, we
  can assume that these APIs are always available, and do away with
  branching around them.

PR-URL: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-05-29 13:01:34 -07:00
Bert Belder
12733dd455
win,pipe: support vectored uv_write() calls
Fixes: https://github.com/libuv/libuv/issues/794
PR-URL: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-05-29 13:01:29 -07:00
Bert Belder
e7e8b6fb9b
win,pipe: properly set uv_write_t.send_handle in uv_write2()
PR-URL: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-05-29 13:01:19 -07:00
Bert Belder
9584df25dc
src,test: fix idiosyncratic comment style
Back in the day I wrote comments in a really unusual way. Nowadays it
makes my eyes bleed, and clang-format doesn't know how to deal with it.

PR-URL: https://github.com/libuv/libuv/pull/1853
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-05-29 11:56:49 -07:00
Björn Linse
62a0f763a7
win,process: allow child pipe handles to be opened in overlapped mode
PR-URL: https://github.com/libuv/libuv/pull/1784
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2018-05-25 15:32:32 -07:00
cjihrig
fe3fbd63e5
unix,windows: map EFTYPE errno
Refs: https://github.com/nodejs/node/pull/20588
PR-URL: https://github.com/libuv/libuv/pull/1836
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-05-09 12:05:46 -04:00
cjihrig
b82c624f74
Now working on version 1.20.4 2018-05-07 18:30:48 -04:00
cjihrig
8cfd67e591
2018.05.08, Version 1.20.3 (Stable)
Changes since version 1.20.2:

* win: add Windows XP support to uv_if_indextoname() (ssrlive)

* win: fix `'floor' undefined` compiler warning (ssrlive)

* win, pipe: stop read for overlapped pipe (Bartosz Sosnowski)

* build: fix utf-8 name of copyright holder (Jérémy Lal)

* zos: initialize pollfd revents (jBarz)

* zos,doc: add system V message queue note (jBarz)

* linux: don't use uv__nonblock_ioctl() on sparc (Ben Noordhuis)
2018-05-07 18:28:28 -04:00
cjihrig
0dd95819ba
Now working on version 1.20.3 2018-04-22 13:59:50 -04:00
cjihrig
c51fd3f66b
2018.04.23, Version 1.20.2 (Stable)
Changes since version 1.20.1:

* zos: use custom semaphore (jBarz)

* win: fix registry API error handling (Kyle Farnung)

* build: add support for 64-bit AIX (Richard Lau)

* aix: guard STATIC_ASSERT for glibc work around (Richard Lau)
2018-04-22 13:58:18 -04:00
John Barboza
1e4823ca99 zos: use custom semaphore
The System V semaphores on z/OS require explicit ending of the worker
threads and cleanup at process exit. The user will have to manually
cleanup these resources that are left behind. Instead use the custom
semaphore implementation which uses posix mutexes and condition
variables which are cleaned up automatically on process exit.

PR-URL: https://github.com/libuv/libuv/pull/1805
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-18 22:24:37 +02:00
cjihrig
d61d6f326c
Now working on version 1.20.2
Fixes: https://github.com/libuv/libuv/issues/1801
2018-04-18 09:21:49 -04:00
cjihrig
36ac2fc8ed
2018.04.19, Version 1.20.1 (Stable)
Changes since version 1.20.0:

* doc,fs: improve documentation (Bob Burger)

* win: return a floored double from uv_uptime() (Refael Ackermann)

* doc: clarify platform specific pipe naming (Thomas Versteeg)

* unix: fix uv_pipe_chmod() on macOS (zzzjim)

* unix: work around glibc semaphore race condition (Anna Henningsen)

* tcp,openbsd: disable Unix TCP check for IPV6_ONLY (Alex Arslan)

* test,openbsd: use RETURN_SKIP in UDP IPv6 tests (Alex Arslan)

* test,openbsd: fix multicast test (Alex Arslan)

* Revert "win, fs: use FILE_WRITE_ATTRIBUTES when opening files"
  (cjihrig)
2018-04-18 09:18:43 -04:00
cjihrig
00d13c5b9f
Now working on version 1.20.1
Fixes: https://github.com/libuv/libuv/issues/1785
2018-04-02 13:25:33 -04:00
cjihrig
0012178ee2
2018.04.03, Version 1.20.0 (Stable)
Changes since version 1.19.2:

* unix,spawn: respect user stdio flags for new pipe (Jameson Nash)

* Revert "Revert "unix,tcp: avoid marking server sockets connected""
  (Jameson Nash)

* req: revisions to uv_req_t handling (Jameson Nash)

* win: remove unnecessary initialization (cjihrig)

* win: update uv_os_homedir() to use uv_os_getenv() (cjihrig)

* test: fix tcp_oob test flakiness (Santiago Gimeno)

* posix: fix uv__pollfds_del() for invalidated fd's (Jesse Gorzinski)

* doc: README: add note on installing gyp (Jamie Davis)

* unix: refactor uv_os_homedir to use uv_os_getenv (Santiago Gimeno)

* unix: fix several instances of lost errno (Michael Kilburn)

* win,tty: update several TODO comments (Ruslan Bekenev)

* unix: add UV_FS_COPYFILE_FICLONE support (cjihrig)

* test: fix connect_unspecified (Santiago Gimeno)

* unix,win: add UV_FS_COPYFILE_FICLONE_FORCE support (cjihrig)

* win: use long directory name for handle->dirw (Nicholas Vavilov)

* build: build with -D_FILE_OFFSET_BITS=64 again (Ben Noordhuis)

* win, fs: fix uv_fs_unlink for +R -A files (Bartosz Sosnowski)

* win, fs: use FILE_WRITE_ATTRIBUTES when opening files (Bartosz
  Sosnowski)

* unix: use __PASE__ on IBM i platforms (Jesse Gorzinski)

* test,freebsd: fix flaky poll tests (Santiago Gimeno)

* test: increase connection timeout to 1 second (jBarz)

* win,tcp: handle canceled connect with ECANCELED (Jameson Nash)
2018-04-02 13:23:58 -04:00
ThePrez
7f85924e8b
unix: use __PASE__ on IBM i platforms
IBM i compilers now predefine __PASE__. This commit updates
code to rely on that rather than manually setting (or relying on)
a _PASE definition.

PR-URL: https://github.com/libuv/libuv/pull/1782
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-03-31 16:41:53 -04:00
cjihrig
3ae88200d6
unix,win: add UV_FS_COPYFILE_FICLONE_FORCE support
UV_FS_COPYFILE_FICLONE_FORCE attempts to use copy-on-write
semantics in uv_fs_copyfile(). If CoW is not available, an
error is returned.

Refs: https://github.com/libuv/libuv/pull/1465
Refs: https://github.com/libuv/libuv/pull/1491
PR-URL: https://github.com/libuv/libuv/pull/1768
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-03-16 01:00:43 -04:00
cjihrig
db918361eb
unix: add UV_FS_COPYFILE_FICLONE support
UV_FS_COPYFILE_FICLONE attemps to use copy-on-write
semantics in uv_fs_copyfile(). If CoW is not available,
it falls back to a normal copy operation.

Refs: https://github.com/libuv/libuv/pull/1465
PR-URL: https://github.com/libuv/libuv/pull/1491
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-03-05 10:18:30 -05:00
Jameson Nash
88c2af0e65
req: revisions to uv_req_t handling
- Remove the `active_reqs` queue, which is never used. There are more
   efficient per-stream queues that `libuv` uses whenever it needs this
   information, so duplicating it and managing it here seems
   like unnecessary extra space and work.
 - Unix `uv_loop_init` didn't explicitly initialize.
   `loop->active_handles` (although it did memset the whole struct
   to 0, so it wasn't wrong previously, just inconsistent).
 - Consolidate repeated code for `uv__has_active_reqs`.
 - Change `uv__loop_alive` to use the helper functions (mirroring the
   unix copy of the same function).
 - Initialize some more uv_stream_t fields in init, rather than waiting
   for the connection callback. This helps surface bugs in libuv or the
   caller better, since it ensures libuv doesn't see uninitialized
   memory if asked to look at these fields before it thinks the socket
   is connected.
 - Fixes what appears to be a double-counting of `handle->reqs_pending`,
   in the highly-unlikely event that the code wants to emulate IOCP,
   but `RegisterWaitForSingleObject` somehow managed to fail.

PR-URL: https://github.com/libuv/libuv/pull/1746
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-02-25 18:49:37 +01:00
cjihrig
cef8a4624b
Now working on version 1.19.3
Fixes: https://github.com/libuv/libuv/issues/1750
2018-02-21 15:29:40 -05:00
cjihrig
c5afc37e2a
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)
2018-02-21 15:25:38 -05: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
cjihrig
faa52872b9
Now working on version 1.19.2 2018-01-19 15:22:56 -05:00
cjihrig
8202d17511
2018.01.20, Version 1.19.1 (Stable)
Changes since version 1.19.0:

* Revert "unix,tcp: avoid marking server sockets connected" (Ben
  Noordhuis)

* Revert "unix,fs: fix for potential partial reads/writes" (Ben
  Noordhuis)

* Revert "win: use RemoveDirectoryW() instead of _wmrmdir()" (Ben
  Noordhuis)

* cygwin: fix compilation of ifaddrs impl (Brad King)
2018-01-19 15:17:23 -05:00
cjihrig
1366e74120
Now working on version 1.19.1
Fixes: https://github.com/libuv/libuv/issues/1697
2018-01-17 10:50:30 -05:00
cjihrig
effbb7c9d2
2018.01.18, Version 1.19.0 (Stable)
Changes since version 1.18.0:

* core: add getter/setter functions for easier ABI compat (Anna
  Henningsen)

* unix: make get(set)_process_title MT-safe (Matt Harrison)

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

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

* win, process: uv_kill improvements (Bartosz Sosnowski)

* win: set _WIN32_WINNT to 0x0600 (cjihrig)

* zos: implement uv_fs_event* functions (jBarz)

* unix,tcp: avoid marking server sockets connected (Jameson Nash)

* doc: mark Windows 7 as Tier 1 support (Bartosz Sosnowski)

* win: map 0.0.0.0 and :: addresses to localhost (Bartosz Sosnowski)

* build: install libuv.pc unconditionally (Ben Noordhuis)

* test: remove custom timeout for thread test on ppc (Ben Noordhuis)

* test: allow multicast not permitted status (Jérémy Lal)

* test: allow net unreachable status in udp test (Ben Noordhuis)

* unix: use SA_RESTART when setting our sighandler (Brad King)

* unix,fs: fix for potential partial reads/writes (Ben Wijen)

* win,build: do not build executable installer for dll (Bert Belder)

* win: allow directory symlinks to be created in a non-elevated context
  (Bert Belder)

* zos,test: accept SIGKILL for flaky test (jBarz)

* win: use RemoveDirectoryW() instead of _wmrmdir() (Ben Noordhuis)

* unix: fix uv_cpu_info() error on FreeBSD (elephantp)

* zos,test: decrease pings to avoid timeout (jBarz)
2018-01-17 10:46:26 -05: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
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
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
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
cjihrig
40a003b4e1
Now working on version 1.17.1 2017-11-23 20:36:59 -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
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
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
cjihrig
6973886ac8
Now working on version 1.16.2 2017-11-10 12:03:09 -05:00
cjihrig
4056fbe464
2017.11.11, Version 1.16.1 (Stable)
Changes since version 1.16.0:

* unix: move net/if.h include (cjihrig)

* win: fix undeclared NDIS_IF_MAX_STRING_SIZE (Nick Logan)
2017-11-10 11:49:42 -05:00
cjihrig
c83f8b91af
unix: move net/if.h include
This commit moves the net/if.h include into src/getaddrinfo.c to
prevent AIX compilation errors. With these symbols exposed
publicly, Node.js compilation failed on AIX by exposing Free(),
which conflicts with another API.

Refs: https://github.com/nodejs/node/pull/16835
Refs: https://github.com/libuv/libuv/pull/1445
PR-URL: https://github.com/libuv/libuv/pull/1622
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-11-09 08:43:22 -05:00
cjihrig
921b030a59
Now working on 1.16.1 2017-11-06 11:31:12 -05:00
cjihrig
d68779f0ea
2017.11.07, Version 1.16.0 (Stable)
Changes since version 1.15.0:

* win: change st_blksize from `2048` to `4096` (Joran Dirk Greef)

* unix,win: add fs open flags, map O_DIRECT|O_DSYNC (Joran Dirk Greef)

* win, fs: fix non-symlink reparse points (Wade Brainerd)

* test: fix -Wstrict-prototypes warnings (Ben Noordhuis)

* unix, windows: map ENOTTY errno (Ben Noordhuis)

* unix: fall back to fsync() if F_FULLFSYNC fails (Joran Dirk Greef)

* unix: do not close invalid kqueue fd after fork (jBarz)

* zos: reset epoll data after fork (jBarz)

* zos: skip fork_threadpool_queue_work_simple (jBarz)

* test: keep platform_output as first test (Bartosz Sosnowski)

* win: fix non-English dlopen error message (Bartosz Sosnowski)

* unix,win: add uv_os_getppid() (cjihrig)

* test: fix const qualification compiler warning (Ben Noordhuis)

* doc: mark uv_default_loop() as not thread safe (rayrase)

* win, pipe: null-initialize stream->shutdown_req (Jameson Nash)

* tty, win: get SetWinEventHook pointer at startup (Bartosz Sosnowski)

* test: no extra new line in skipped test output (Bartosz Sosnowski)

* pipe: allow access from other users (Bartosz Sosnowski)

* unix,win: add uv_if_{indextoname,indextoiid} (Pekka Nikander)
2017-11-06 11:20:52 -05:00
Pekka Nikander
695afe8322
unix,win: add uv_if_{indextoname,indextoiid}
uv_if_indextoname() is used to convert an IPv6 scope_id
to an interface identifier string such as %eth0 or %lo.

uv_if_indextoiid() returns an IPv6 interface identifier.
On Unix it calls uv_if_indextoname(). On Windows it uses
snprintf() to return the numeric interface identifier as
a string.

Refs: https://github.com/nodejs/node/pull/14500
PR-URL: https://github.com/libuv/libuv/pull/1445
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-06 09:54:47 -05:00
Bartosz Sosnowski
fd02ab681b pipe: allow access from other users
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>
2017-11-06 15:45:00 +01:00
cjihrig
e8e6a8a500
unix,win: add uv_os_getppid()
Refs: https://github.com/nodejs/node/issues/14957
PR-URL: https://github.com/libuv/libuv/pull/1610
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-01 10:32:12 -04:00
Ben Noordhuis
e9cda2cfe7 unix, windows: map ENOTTY errno
PR-URL: https://github.com/libuv/libuv/pull/1582
Refs: https://github.com/libuv/libuv/issues/1579
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-10-05 22:29:18 +02:00
Joran Dirk Greef
4b666bd2d8 unix,win: add fs open flags, map O_DIRECT|O_DSYNC
Define stable cross-platform file open constants so that users can
pass `UV_FS_O_RDWR` rather than `_O_RDWR` (win) or `O_RDWR` (unix).

Map `UV_FS_O_DIRECT`, `UV_FS_O_DSYNC` and `UV_FS_O_SYNC` to
`FILE_FLAG_NO_BUFFERING` and `FILE_FLAG_WRITE_THROUGH` (win).

Fixes: https://github.com/libuv/libuv/issues/1550
PR-URL: https://github.com/libuv/libuv/pull/1567
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-10-03 12:49:54 +02:00
cjihrig
94f507535c
Now working on version 1.15.1 2017-10-02 19:41:06 -04:00
cjihrig
8b69ce1419
2017.10.03, Version 1.15.0 (Stable)
Changes since version 1.14.1:

* unix: limit uv__has_forked_with_cfrunloop to macOS (Kamil Rytarowski)

* win: fix buffer size in uv__getpwuid_r() (tux.uudiin)

* win,tty: improve SIGWINCH support (Bartosz Sosnowski)

* unix: use fchmod() in uv_fs_copyfile() (cjihrig)

* unix: support copying empty files (cjihrig)

* unix: truncate destination in uv_fs_copyfile() (Nick Logan)

* win,build: keep cwd when setting build environment (darobs)

* test: add NetBSD support to test-udp-ipv6.c (Kamil Rytarowski)

* unix: add NetBSD support in core.c (Kamil Rytarowski)

* linux: increase thread stack size with musl libc (Ben Noordhuis)

* netbsd: correct uv_exepath() on NetBSD (Kamil Rytarowski)

* test: clean up semaphore after use (jBarz)

* win,build: bump vswhere_usability_wrapper to 2.0.0 (Refael Ackermann)

* win: let UV_PROCESS_WINDOWS_HIDE hide consoles (cjihrig)

* zos: lock protect global epoll list in epoll_ctl (jBarz)

* zos: change platform name to match python (jBarz)

* android: fix getifaddrs() (Zheng, Lei)

* netbsd: implement uv__tty_is_slave() (Kamil Rytarowski)

* zos: fix readlink for mounts with system variables (jBarz)

* test: sort the tests alphabetically (Sakthipriyan Vairamani)

* windows: fix compilation warnings (Carlo Marcelo Arenas Belón)

* build: avoid -fstrict-aliasing compile option (jBarz)

* win: remove unused variables (Carlo Marcelo Arenas Belón)

* unix: remove unused variables (Sakthipriyan Vairamani)

* netbsd: disable poll_bad_fdtype on NetBSD (Kamil Rytarowski)

* netbsd: use uv__cloexec and uv__nonblock (Kamil Rytarowski)

* test: fix udp_multicast_join6 on NetBSD (Kamil Rytarowski)

* unix,win: add uv_mutex_init_recursive() (Scott Parker)

* netbsd: do not exclude IPv6 functionality (Kamil Rytarowski)

* fsevents: watch files with fsevents on macos 10.7+ (Ben Noordhuis)

* unix: retry on ENOBUFS in sendmsg(2) (Kamil Rytarowski)
2017-10-02 19:30:27 -04:00
Scott Parker
ec96b55438
unix,win: add uv_mutex_init_recursive()
Support the creation of recursive mutexes on Unix. A matching
API is added on Windows, however mutexes on Windows are always
recursive.

Refs: https://github.com/libuv/libuv/issues/1022
PR-URL: https://github.com/libuv/libuv/pull/1555
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-02 10:01:09 -04:00
cjihrig
1a682cb7c0
Now working on version 1.14.2 2017-09-06 09:50:12 -04:00
cjihrig
b0f9fb2a07
2017.09.07, Version 1.14.1 (Stable)
Changes since version 1.14.0:

* fs, win: add support for user symlinks (Bartosz Sosnowski)

* cygwin: include uv-posix.h header (Joel Winarske)

* zos: fix semaphore initialization (jBarz)

* zos: improve loop_count benchmark performance (jBarz)

* zos, test: flush out the oob data in callback (jBarz)

* unix,win: check for bad flags in uv_fs_copyfile() (cjihrig)

* unix: modify argv[0] when process title is set (Matthew Taylor)

* unix: don't use req->loop in uv__fs_copyfile() (cjihrig)

* doc: fix a trivial typo (Vladimír Čunát)

* android: fix uv_cond_timedwait on API level < 21 (Gergely Nagy)

* win: add uv__once_init() calls (Bartosz Sosnowski)

* unix,windows: init all requests in fs calls (cjihrig)

* unix,windows: return UV_EINVAL on NULL fs reqs (cjihrig)

* windows: add POST macro to fs functions (cjihrig)

* unix: handle partial sends in uv_fs_copyfile() (A. Hauptmann)

* Revert "win, test: fix double close in test runner" (Bartosz
  Sosnowski)

* win, test: remove surplus CloseHandle (Bartosz Sosnowski)
2017-09-06 09:41:30 -04:00
cjihrig
c8ee8bef9b
Now working on version 1.14.1 2017-08-16 10:21:47 -04:00
cjihrig
e0d31e9e21
2017.08.17, Version 1.14.0 (Stable)
Changes since version 1.13.1:

* unix: check for NULL in uv_os_unsetenv for parameter name (André
  Klitzing)

* doc: add thread safety warning for process title (Matthew Taylor)

* unix: always copy process title into local buffer (Matthew Taylor)

* poll: add support for OOB TCP and GPIO interrupts (CurlyMoo)

* win,build: fix appveyor properly (Refael Ackermann)

* win: include filename in dlopen error message (Ben Noordhuis)

* aix: add netmask, mac address into net interfaces (Gireesh Punathil)

* unix, windows: map EREMOTEIO errno (Ben Noordhuis)

* unix: fix wrong MAC of uv_interface_address (XadillaX)

* win,build: fix building from Windows SDK or VS console (Saúl Ibarra
  Corretgé)

* github: fix link to help repo in issue template (Ben Noordhuis)

* zos: remove nonexistent include from autotools build (Saúl Ibarra
  Corretgé)

* misc: remove reference to pthread-fixes.h from LICENSE (Saúl Ibarra
  Corretgé)

* docs: fix guide source code example paths (Anticrisis)

* android: fix compilation with new NDK versions (Saúl Ibarra Corretgé)

* misc: add android-toolchain to .gitignore (Saúl Ibarra Corretgé)

* win, fs: support unusual reparse points (Bartosz Sosnowski)

* android: fix detection of pthread_condattr_setclock (Saúl Ibarra
  Corretgé)

* android: remove no longer needed check (Saúl Ibarra Corretgé)

* doc: update instructions for building on Android (Saúl Ibarra
  Corretgé)

* win, process: support semicolons in PATH variable (Bartosz Sosnowski)

* doc: document uv_async_(init|send) return values (Ben Noordhuis)

* doc: add Android as a tier 3 supported platform (Saúl Ibarra Corretgé)

* unix: add missing semicolon (jBarz)

* win, test: fix double close in test runner (Bartosz Sosnowski)

* doc: update supported windows version baseline (Ben Noordhuis)

* test,zos: skip chown root test (jBarz)

* test,zos: use gid=-1 to test spawn_setgid_fails (jBarz)

* zos: fix hr timer resolution (jBarz)

* android: fix blocking recvmsg due to netlink bug (Jacob Segal)

* zos: read more accurate rss info from RSM (jBarz)

* win: allow bound/connected socket in uv_tcp_open() (Maciej Szeptuch
  (Neverous))

* doc: differentiate SmartOS and SunOS support (cjihrig)

* unix: make uv_poll_stop() remove fd from pollset (Ben Noordhuis)

* unix, windows: add basic uv_fs_copyfile() (cjihrig)
2017-08-16 10:11:33 -04:00
cjihrig
766d7e9c0b
unix, windows: add basic uv_fs_copyfile()
Fixes: https://github.com/libuv/libuv/issues/925
PR-URL: https://github.com/libuv/libuv/pull/1465
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-08-15 10:43:49 -04:00
Saúl Ibarra Corretgé
7dabd57af4 android: fix compilation with new NDK versions
Fixes compiling with Android NDK when using Unified Headers (default
since r15).

Fixes: https://github.com/libuv/libuv/issues/1417
PR-URL: https://github.com/libuv/libuv/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-25 22:50:39 +02:00
Ben Noordhuis
8e76306ec2 unix, windows: map EREMOTEIO errno
PR-URL: https://github.com/libuv/libuv/pull/1424
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-17 13:31:58 +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
cjihrig
d63030b0ba Now working on version 1.13.2 2017-07-06 18:49:48 -04:00
cjihrig
2bb4b68758 2017.07.07, Version 1.13.1 (Stable)
Changes since version 1.13.0:

* Now working on version 1.13.1 (cjihrig)

* build: workaround AppVeyor quirk (Refael Ackermann)
2017-07-06 18:42:36 -04:00
cjihrig
a7aa057113 Now working on version 1.13.1 2017-07-05 16:47:53 -04:00
cjihrig
8342fcaab8 2017.07.06, Version 1.13.0 (Stable)
Changes since version 1.12.0:

* Now working on version 1.12.1 (cjihrig)

* unix: avoid segfault in uv_get_process_title (Michele Caini)

* build: add a comma to uv.gyp (Gemini Wen)

* win: restore file pos after positional read/write (Bartosz Sosnowski)

* unix,stream: return error on closed handle passing (Santiago Gimeno)

* unix,benchmark: use fd instead of FILE* after fork (jBarz)

* zos: avoid compiler warnings (jBarz)

* win,pipe: race condition canceling readfile thread (Jameson Nash)

* sunos: filter out non-IPv4/IPv6 interfaces (Sebastian Wiedenroth)

* sunos: fix cmpxchgi and cmpxchgl type error (Sai Ke WANG)

* unix: reset signal disposition before execve() (Ben Noordhuis)

* unix: reset signal mask before execve() (Ben Noordhuis)

* unix: fix POLLIN assertion on server read (jBarz)

* zos: use stckf builtin for high-res timer (jBarz)

* win,udp: implements uv_udp_try_send (Barnabas Gema)

* win,udp: return UV_EINVAL instead of aborting (Romain Caire)

* freebsd: replace kvm with sysctl (Robert Ayrapetyan)

* aix: fix un-initialized pointer field in fs handle (Gireesh Punathil)

* win,build: support building with VS2017 (Refael Ackermann)

* doc: add instructions for building on Windows (Refael Ackermann)

* doc: format README (Refael Ackermann)
2017-07-05 11:55:39 -04:00
cjihrig
42bf398b80 Now working on version 1.12.1 2017-05-30 12:36:19 -04:00
cjihrig
d6ac141ac6 2017.05.31, Version 1.12.0 (Stable)
Changes since version 1.11.0:

* Now working on version 1.11.1 (cjihrig)

* test: fix tests on OpenBSD (Santiago Gimeno)

* test: fix -Wformat warning (Santiago Gimeno)

* win,fs: avoid double freeing uv_fs_event_t.dirw (Vladimir Matveev)

* unix: remove unused code in `uv__io_start` (Fedor Indutny)

* signal: add uv_signal_start_oneshot method (Santiago Gimeno)

* unix: factor out reusable POSIX hrtime impl (Brad King)

* unix,win: add uv_os_{get,set,unset}env() (cjihrig)

* win: add uv__convert_utf8_to_utf16() (cjihrig)

* docs: improve UV_ENOBUFS scenario documentation (cjihrig)

* unix: return UV_EINVAL for NULL env name (jBarz)

* unix: filter getifaddrs results consistently (Brad King)

* unix: factor out getifaddrs result filter (Brad King)

* unix: factor out reusable BSD ifaddrs impl (Brad King)

* unix: use union to follow strict aliasing rules (jBarz)

* unix: simplify async watcher dispatch logic (Ben Noordhuis)

* samples: update timer callback prototype (Ben Noordhuis)

* unix: make loops and watchers usable after fork() (Jason Madden)

* win: free uv__loops once empty (cjihrig)

* tools: add make_dist_html.py script (Ben Noordhuis)

* win,sunos: stop handle on uv_fs_event_start() err (cjihrig)

* unix,windows: refactor request init logic (Ben Noordhuis)

* win: fix memory leak inside uv__pipe_getname (A. Hauptmann)

* fsevent: support for files without short name (Bartosz Sosnowski)

* doc: fix multiple doc typos (Jamie Davis)

* test,osx: fix flaky kill test (Santiago Gimeno)

* unix: inline uv_pipe_bind() err_bind goto target (cjihrig)

* unix,test: deadstore fixes (Rasmus Christian Pedersen)

* win: fix memory leak inside uv_fs_access() (A. Hauptmann)

* doc: fix docs/src/fs.rst build warning (Daniel Bevenius)

* doc: minor grammar fix in Installation section (Daniel Bevenius)

* doc: suggestions for design page (Daniel Bevenius)

* doc: libuv does not touch uv_loop_t.data (Ben Noordhuis)

* github: add ISSUE_TEMPLATE.md (Ben Noordhuis)

* doc: add link to libuv/help to README (Ben Noordhuis)

* udp: fix fast path in uv_udp_send() on unix (Fedor Indutny)

* test: add test for uv_udp_send() fix (Trevor Norris)

* doc: fix documentation for uv_handle_t.type (Daniel Kahn Gillmor)

* zos: use proper prototype for epoll_init() (Ben Noordhuis)

* doc: rename docs to "libuv documentation" (Saúl Ibarra Corretgé)

* doc: update copyright years (Saúl Ibarra Corretgé)

* doc: move TOC to a dedicated document (Saúl Ibarra Corretgé)

* doc: move documentation section up (Saúl Ibarra Corretgé)

* doc: move "upgrading" to a standalone document (Saúl Ibarra Corretgé)

* doc: add initial version of the User Guide (Saúl Ibarra Corretgé)

* doc: removed unused file (Saúl Ibarra Corretgé)

* doc: update guide/about and mention new maintainership (Saúl Ibarra
  Corretgé)

* doc: remove licensing note from guide/about (Saúl Ibarra Corretgé)

* doc: add warning note to user guide (Saúl Ibarra Corretgé)

* doc: change license to CC BY 4.0 (Saúl Ibarra Corretgé)

* doc: remove ubvook reference from README (Saúl Ibarra Corretgé)

* doc: add code samples from uvbook (unadapted) (Saúl Ibarra Corretgé)

* doc: update supported linux/glibc baseline (Ben Noordhuis)

* win: avoid leaking pipe handles to child processes (Jameson Nash)

* win,test: support stdout output larger than 1kb (Bartosz Sosnowski)

* win: remove __declspec(inline) from atomic op (Keane)

* test: fix VC++ compilation warning (Rasmus Christian Pedersen)

* build: add -Wstrict-prototypes (Jameson Nash)

* zos: implement uv__io_fork, skip fs event tests (jBarz)

* unix: do not close udp sockets on bind error (Marc Schlaich)

* unix: remove FSEventStreamFlushSync() call (cjihrig)

* build,openbsd: remove kvm-related code (James McCoy)

* test: fix flaky tcp-write-queue-order (Santiago Gimeno)

* unix,win: add uv_os_gethostname() (cjihrig)

* zos: increase timeout for tcp_writealot (jBarz)

* zos: do not inline OOB data by default (jBarz)

* test: fix -Wstrict-prototypes compiler warnings (Ben Noordhuis)

* unix: factor out reusable no-proctitle impl (Brad King)

* test: factor out fsevents skip explanation (Brad King)

* test: skip fork fsevent cases when lacking support (Brad King)

* unix: factor out reusable no-fsevents impl (Brad King)

* unix: factor out reusable sysinfo memory lookup (Brad King)

* unix: factor out reusable sysinfo loadavg impl (Brad King)

* unix: factor out reusable procfs exepath impl (Brad King)

* unix: add a uv__io_poll impl using POSIX poll(2) (Brad King)

* cygwin: implement support for cygwin and msys2 (Brad King)

* cygwin: recognize EOF on named pipe closure (Brad King)

* cygwin: fix uv_pipe_connect report of ENOTSOCK (Brad King)

* cygwin: disable non-functional ipc handle send (Brad King)

* test: skip self-connecting tests on cygwin (Brad King)

* doc: mark uv_loop_fork() as experimental (cjihrig)

* doc: add bzoz to maintainers (Bartosz Sosnowski)

* doc: fix memory leak in tcp-echo-server example (Bernardo Ramos)

* win: make uv__get_osfhandle() public (Juan Cruz Viotti)

* doc: use valid pipe name in pipe-echo-server (Bernardo Ramos)
2017-05-30 12:18:19 -04:00
Juan Cruz Viotti
e133923e93 win: make uv__get_osfhandle() public
The uv__get_osfhandle() function is a private functio of the
Windows subsystem, and its used to get a Windows HANDLE out
of a file descriptor number.

The motivation behind making this function public is to
allow Node.js programs to pass file descriptors created
using fs.open() to native Node.js C++ add-ons, and be able to
successfully convert them to Windows HANDLEs.

Refs: https://github.com/libuv/libuv/pull/1166
Refs: https://github.com/nodejs/node/issues/6369
Fixes: https://github.com/libuv/libuv/issues/1291
PR-URL: https://github.com/libuv/libuv/pull/1323
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-30 11:53:31 -04: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
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
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
cjihrig
ee02f60c90 unix,win: add uv_os_{get,set,unset}env()
These functions are used to create, retrieve, update, and delete
environment variables.

Fixes: https://github.com/libuv/libuv/issues/1198
PR-URL: https://github.com/libuv/libuv/pull/1234
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-03-08 20:39:33 -05:00
Santiago Gimeno
45616f542d
signal: add uv_signal_start_oneshot method
It behaves as `uv_signal_start` but it resets the signal handler as soon
as the signal is received.

Fixes: https://github.com/libuv/libuv/issues/1104
PR-URL: https://github.com/libuv/libuv/pull/1106
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-02-28 14:16:54 +01:00
cjihrig
c42d31ba53 Now working on version 1.11.1 2017-01-31 19:50:51 -05:00
cjihrig
7452ef4e06 2017.02.02, Version 1.11.0 (Stable)
Changes since version 1.10.2:

* Now working on version 1.10.3 (cjihrig)

* win: added fcntl.h to uv-win.h (Michele Caini)

* unix: move function call out of assert (jBarz)

* fs: cleanup uv__fs_scandir (Santiago Gimeno)

* fs: fix crash in uv_fs_scandir_next (muflub)

* win,signal: fix potential deadlock (Bartosz Sosnowski)

* unix: use async-signal safe functions between fork and exec (jBarz)

* sunos: fix SUNOS_NO_IFADDRS build (Ben Noordhuis)

* zos: make platform functional (John Barboza)

* doc: add repitition qualifier to version regexs (Daniel Bevenius)

* zos: use gyp OS label "os390" on z/OS (John Barboza)

* aix: enable uv_get/set_process_title (Howard Hellyer)

* zos: use built-in proctitle implementation (John Barboza)

* Revert "darwin: use clock_gettime in macOS 10.12" (Chris Araman)

* win,test: don't write uninitialized buffer to tty (Bert Belder)

* win: define ERROR_ELEVATION_REQUIRED for MinGW (Richard Lau)

* aix: re-enable fs watch facility (Gireesh Punathil)
2017-01-31 19:38:56 -05: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
Michele Caini
2e5ad25cad
win: added fcntl.h to uv-win.h
PR-URL: https://github.com/libuv/libuv/pull/1130
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-01-14 21:38:44 +01:00
cjihrig
65751b5cd6 Now working on version 1.10.3 2017-01-09 13:56:05 -05:00
cjihrig
cb9f579a45 2017.01.10, Version 1.10.2 (Stable)
Changes since version 1.10.1:

* Now working on version 1.10.2 (cjihrig)

* darwin: fix fsync and fdatasync (Joran Dirk Greef)

* Revert "Revert "win,tty: add support for ANSI codes in win10 v1511""
  (Santiago Gimeno)

* win,tty: fix MultiByteToWideChar output buffer (Santiago Gimeno)

* win: remove dead code related to BACKUP_SEMANTICS (Sam Roberts)

* win: fix comment in quote_cmd_arg (Eric Sciple)

* darwin: use clock_gettime in macOS 10.12 (Saúl Ibarra Corretgé)

* win, tty: fix crash on restarting with pending data (Nicholas Vavilov)

* fs: fix uv__to_stat on BSD platforms (Santiago Gimeno)

* win: map ERROR_ELEVATION_REQUIRED to UV_EACCES (Richard Lau)

* win: fix free() on bad input in uv_getaddrinfo() (Ben Noordhuis)
2017-01-09 13:42:49 -05:00
cjihrig
a2a85f823f Now working on version 1.10.2 2016-11-16 13:19:32 -05:00
cjihrig
2e49e332bd 2016.11.17, Version 1.10.1 (Stable)
Changes since version 1.10.0:

* Now working on version 1.10.1 (cjihrig)

* win: fix anonymous union syntax (Brad King)

* unix: use uv__is_closing everywhere (Santiago Gimeno)

* win: add missing break statement (cjihrig)

* doc: fix wrong man page link for uv_fs_lstat() (Michele Caini)

* win, tty: handle empty buffer in uv_tty_write_bufs (Hitesh
  Kanwathirtha)

* doc: add cjihrig alternative GPG ID (cjihrig)

* Revert "win,tty: add support for ANSI codes in win10 v1511" (Ben
  Noordhuis)
2016-11-16 13:03:50 -05:00
cjihrig
531f06ecfe Now working on version 1.10.1 2016-10-24 10:24:20 -04:00
cjihrig
c8a373c729 2016.10.25, Version 1.10.0 (Stable)
Changes since version 1.9.1:

* Now working on version 1.9.2 (Saúl Ibarra Corretgé)

* doc: add cjihrig GPG ID (cjihrig)

* win,build: fix compilation on old Windows / MSVC (Saúl Ibarra
  Corretgé)

* darwin: fix setting fd to non-blocking in select(() trick (Saúl Ibarra
  Corretgé)

* unix: allow nesting of kqueue fds in uv_poll_start (Ben Noordhuis)

* doc: fix generation the first time livehtml runs (Saúl Ibarra
  Corretgé)

* test: fix test_close_accept flakiness on Centos5 (Santiago Gimeno)

* license: libuv is no longer a Node project (Saúl Ibarra Corretgé)

* license: add license text we've been using for a while (Saúl Ibarra
  Corretgé)

* doc: add licensing information to README (Saúl Ibarra Corretgé)

* win,pipe: fixed formatting, DWORD is long unsigned (Miodrag Milanovic)

* win: support sub-second precision in uv_fs_futimes() (Jason
  Ginchereau)

* unix: ignore EINPROGRESS in uv__close (Saúl Ibarra Corretgé)

* doc: add Imran Iqbal (iWuzHere) to maintainers (Imran Iqbal)

* doc: update docs with AIX related information (Imran Iqbal)

* test: silence build warnings (Kári Tristan Helgason)

* doc: add iWuzHere GPG ID (Imran Iqbal)

* linux-core: fix uv_get_total/free_memory on uclibc (Nicolas Cavallari)

* build: fix build on DragonFly (Michael Neumann)

* unix: correctly detect named pipes on DragonFly (Michael Neumann)

* test: make tap output the default (Ben Noordhuis)

* test: don't dump output for skipped tests (Ben Noordhuis)

* test: improve formatting of diagnostic messages (Ben Noordhuis)

* test: remove unused RETURN_TODO macro (Ben Noordhuis)

* doc: fix stream typos (Pierre-Marie de Rodat)

* doc: update coding style link (Imran Iqbal)

* unix,fs: use uint64_t instead of unsigned long (Imran Iqbal)

* build: check for warnings for -fvisibility=hidden (Imran Iqbal)

* unix: remove unneeded TODO note (Saúl Ibarra Corretgé)

* test: skip tty_pty test if pty is not available (Luca Bruno)

* sunos: set phys_addr of interface_address using ARP (Brian Maher)

* doc: clarify callbacks won't be called in error case (Saúl Ibarra
  Corretgé)

* unix: don't convert stat buffer when syscall fails (Ben Noordhuis)

* win: compare entire filename in watch events (cjihrig)

* doc: add a note on safe reuse of uv_write_t (neevek)

* linux: fix potential event loop stall (Ben Noordhuis)

* unix,win: make uv_get_process_title() stricter (cjihrig)

* test: close server before initiating new connection (John Barboza)

* test: account for multiple handles in one ipc read (John Barboza)

* unix: fix errno and retval conflict (liuxiaobo)

* doc: add missing entry in uv_fs_type enum (Michele Caini)

* unix: preserve loop->data across loop init/done (Ben Noordhuis)

* win: return UV_EINVAL on bad uv_tty_mode mode arg (Ben Noordhuis)

* win: simplify memory copy logic in fs.c (Ben Noordhuis)

* win: fix compilation on mingw (Bartosz Sosnowski)

* win: ensure 32-bit printf precision (Matej Knopp)

* darwin: handle EINTR in /dev/tty workaround (Ben Noordhuis)

* test: fix OOB buffer access (Saúl Ibarra Corretgé)

* test: don't close CRT fd handed off to uv_pipe_t (Saúl Ibarra
  Corretgé)

* test: fix android build error. (sunjin.lee)

* win: evaluate timers when system wakes up (Bartosz Sosnowski)

* doc: add supported platforms description (Saúl Ibarra Corretgé)

* win: fix lstat reparse point without link data (Jason Ginchereau)

* unix,win: make on_alloc_cb failures more resilient (Saúl Ibarra
  Corretgé)

* zos: add support for new platform (John Barboza)

* test: make tcp_close_while_connecting more resilient (Saúl Ibarra
  Corretgé)

* build: use '${prefix}' for pkg-config 'exec_prefix' (Matt Clarkson)

* build: GNU/kFreeBSD support (Jeffrey Clark)

* zos: use PLO instruction for atomic operations (John Barboza)

* zos: use pthread helper functions (John Barboza)

* zos: implement uv__fs_futime (John Barboza)

* unix: expand range of values for usleep (John Barboza)

* zos: track unbound handles and bind before listen (John Barboza)

* test: improve tap output on test failures (Santiago Gimeno)

* test: refactor fs_event_close_in_callback (Julien Gilli)

* zos: implement uv__io_check_fd (John Barboza)

* unix: unneccessary use const qualifier in container_of (John Barboza)

* win,tty: add support for ANSI codes in win10 v1511 (Imran Iqbal)

* doc: add santigimeno to maintainers (Santiago Gimeno)

* win: fix typo in type name (Saúl Ibarra Corretgé)

* unix: always define pthread barrier fallback pad (Saúl Ibarra
  Corretgé)

* test: use RETURN_SKIP in spawn_setuid_setgid test (Santiago Gimeno)

* win: add disk read/write count to uv_getrusage (Imran Iqbal)

* doc: document uv_fs_realpath caveats (Saúl Ibarra Corretgé)

* test: improve spawn_setuid_setgid test (Santiago Gimeno)

* test: fix building pty test on Android (Saúl Ibarra Corretgé)

* doc: uv_buf_t members are not readonly (Saúl Ibarra Corretgé)

* doc: improve documentation on uv_alloc_cb (Saúl Ibarra Corretgé)

* fs: fix uv_fs_fstat on platforms using musl libc (Santiago Gimeno)

* doc: update supported fields for uv_rusage_t (Imran Iqbal)

* test: fix test-tcp-writealot flakiness on arm (Santiago Gimeno)

* test: fix fs_event_watch_dir flakiness on arm (Santiago Gimeno)

* unix: don't use alphasort in uv_fs_scandir() (Ben Noordhuis)

* doc: fix confusing doc of uv_tcp_nodelay (Bart Robinson)

* build,osx: fix warnings on tests compilation with gyp (Santiago
  Gimeno)

* doc: add ABI tracker link to README (Saúl Ibarra Corretgé)

* win,tty: fix uv_tty_set_mode race conditions (Bartosz Sosnowski)

* test: fix fs_fstat on Android (Vit Gottwald)

* win, test: fix fs_event_watch_dir_recursive (Bartosz Sosnowski)

* doc: add description of uv_handle_type (Vit Gottwald)

* build: use -pthreads for tests with autotools (Julien Gilli)

* win: fix leaky fs request buffer (Jason Ginchereau)

* doc: note buffer lifetime requirements in uv_write (Vladimír Čunát)

* doc: add reference to uv_update_time on uv_timer_start (Alex Hultman)

* win: fix winapi function pointer typedef syntax (Brad King)

* test: fix tcp_close_while_connecting CI failures (Ben Noordhuis)

* test: make threadpool_cancel_single deterministic (Ben Noordhuis)

* test: make threadpool saturation reliable (Ben Noordhuis)

* unix: don't malloc in uv_thread_create() (Ben Noordhuis)

* unix: don't include CoreServices globally on macOS (Brad King)

* unix,win: add uv_translate_sys_error() public API (Philippe
  Laferriere)

* win: remove unused static variables (Ben Noordhuis)

* win: silence -Wmaybe-uninitialized warning (Ben Noordhuis)

* signal: replace pthread_once with uv_once (Santiago Gimeno)

* test: fix sign-compare warning (Will Speak)

* common: fix unused variable warning (Brad King)
2016-10-24 09:52:33 -04:00
Philippe Laferriere
f1863dae6b unix,win: add uv_translate_sys_error() public API
uv_translate_sys_error() was a private function for Windows.
This commit adds an equivalent function on other platforms, and
exposes it as public API.

Exposing this is useful in scenarios where the application uses
both libuv functions and platform-specific system calls and wants
to report errors uniformly as libuv errors.

Fixes: https://github.com/libuv/libuv/issues/79
PR-URL: https://github.com/libuv/libuv/pull/1060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-10-16 17:47:42 -04:00
Brad King
cfc192212e win: fix winapi function pointer typedef syntax
Move the `PASCAL` calling convention marker from:

    typedef void PASCAL (*f)(...);

to the proper place for a calling convention in a function pointer type:

    typedef void (PASCAL *f)(...);

This is where the MS-provided winapi headers place it too.

PR-URL: https://github.com/libuv/libuv/pull/1075
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-10-14 07:30:08 +02:00
Saúl Ibarra Corretgé
5d96277834 unix: always define pthread barrier fallback pad
Fixes: https://github.com/libuv/libuv/issues/1019
PR-URL: https://github.com/libuv/libuv/pull/1020
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-08-27 11:06:19 +02: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
John Barboza
1cff5b7557 zos: add support for new platform
- zos: disable test cases not applicable
- zos: build options
- zos: semaphore implementation
- zos: use compare and swap builtins
- zos: struct rusage not the same as other platforms
- zos: backlog<=0 produces undefined behaviour
    Will redefine backlog in the following way
    * if backlog == 0, set it to 1
    * if backlog < 0, set it to SOMAXCONN
- zos: define IMAXBEL as empty flag and implement uv__tty_make_raw
- zos: use udp multicast operations from aix
- zos: ESC in ebcdic
- zos: use LIBPATH for dynamic linker path
- zos: uv_udp_set_ttl only works for ipv6
- zos: increase pthread stack size by factor of 4
- zos: return ENODEV instead of ENXIO errors for setsockopt
- zos: use uv_cond_init the same way as aix
- test: enable oob test for zos
- zos: return EINVAL for zos error code EOPNOTSUPP

PR-URL: https://github.com/libuv/libuv/pull/937
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-08-19 01:34:29 +02:00
Saúl Ibarra Corretgé
67f4d1c531 Now working on version 1.9.2 2016-05-16 23:49:30 +02:00
Saúl Ibarra Corretgé
d989902ac6 2016.05.17, Version 1.9.1 (Stable)
Changes since version 1.9.0:

* test: handle root home directories (cjihrig)

* unix: implement uv__fs_futime for AIX 7.1 (Imran Iqbal)

* test: skip early bind tests if no IPv6 is supported (Saúl Ibarra
  Corretgé)

* win: fix var declaration to be C89 compliant (Michael Fero)

* unix: use POLL{IN,OUT,etc} constants directly (Ben Noordhuis)

* doc: add ability to live reload and regenerate HTML (Saúl Ibarra
  Corretgé)

* Revert "win,build: remove unused build defines" (cjihrig)

* linux: fix fd leaks in uv_cpu_info() error paths (Ben Noordhuis)

* linux: don't abort on malformed /proc/stat (Ben Noordhuis)

* linux: fix long lines in linux-core.c (Ben Noordhuis)

* test: fix fs_event_watch_file_current_dir for AIX (Imran Iqbal)

* unix,fs: code cleanup of uv_fs_event_start for AIX (Imran Iqbal)

* unix: delay signal handling until after normal i/o (Ben Noordhuis)

* android: pthread_sigmask() does not set errno (Oguz Bastemur)

* win: work around sharepoint scandir bug (Ben Noordhuis)

* unix: guard against clobbering errno in uv__free() (Ben Noordhuis)

* unix: remove unneeded SAVE_ERRNO wrappers (Ben Noordhuis)

* test: skip fs_event_close_in_callback on AIX (Imran Iqbal)

* win: add maxrss, pagefaults to uv_getrusage() (Robert Jefe Lindstaedt)

* test: set a big send buffer size for tcp_write_queue_order (Andrius
  Bentkus)

* unix: error on realpath if PATH_MAX is undefined (Myles Borins)

* unix: fix bug in barrier fallback implementation (Kári Tristan
  Helgason)

* build: bump android ndk version (Kári Tristan Helgason)

* build: always compile with -fvisibility=hidden (Ben Noordhuis)

* test: fix -Wformat warnings in platform test (Ben Noordhuis)

* win: clarify fsevents handling code (Saúl Ibarra Corretgé)

* test: fix POLLHDRUP related failures for AIX (Imran Iqbal)

* build, mingw: set LIBS in configure.ac (Tony Theodore)

* win: improve uv__convert_utf16_to_utf8 (Saúl Ibarra Corretgé)

* win: simplified UTF16 -> UTF8 conversions (Saúl Ibarra Corretgé)

* win: remove unneeded condition (Saúl Ibarra Corretgé)

* darwin: work around condition variable kernel bug (Ben Noordhuis)

* darwin: make thread stack multiple of page size (Ben Noordhuis)

* build,win: rename platform to msbuild_platform (João Reis)

* gitignore: ignore VS temporary database files (João Reis)

* test: skip emfile on AIX (Imran Iqbal)

* unix: use system allocator for scandir() (cjihrig)

* common: release uv_fs_scandir() array (cjihrig)

* win: call uv__fs_scandir_cleanup() (cjihrig)

* win,tty: fix read stop in line mode (João Reis)

* win,tty: don't duplicate handle for line reads (João Reis)

* win,tty: restore cursor after canceling line read (Alexis Campailla)
2016-05-16 23:22:19 +02:00
João Reis
349aa6c0dd win,tty: don't duplicate handle for line reads
Since we cancel ReadConsole by sending a newline, the duplicate
handle is no longer necessary.

PR-URL: https://github.com/libuv/libuv/pull/866
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-05-16 23:05:50 +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
Saúl Ibarra Corretgé
d476185bb3 Now working on version 1.9.1 2016-04-07 07:52:59 -03:00
Saúl Ibarra Corretgé
229b3a4cc1 2016.04.08, Version 1.9.0 (Stable)
Changes since version 1.8.0:

* win: wait for full timeout duration (João Reis)

* unix: fix support for uClibc-ng (Martin Bark)

* doc: indicate where new test files need to be added (Dave)

* test,unix: fix logic error in test runner (Ben Noordhuis)

* fs: don't nullify req->bufs on EINTR (Dave)

* osx: set the default thread stack size to RLIMIT_STACK (Saúl Ibarra
  Corretgé)

* build: invoke libtoolize with --copy (Ben Noordhuis)

* test: fixup eintr_handling (Saúl Ibarra Corretgé)

* osx: avoid compilation warning with Clang (Saúl Ibarra Corretgé)

* test,win: fix compilation with shared lib (Alexis Murzeau)

* test: fix race condition in pipe-close-stdout (Imran Iqbal)

* unix,win: add uv_os_tmpdir() (cjihrig)

* ios: fix undefined PTHREAD_STACK_MIN (Didiet)

* test: fix threadpool_multiple_event_loops for AIX (Imran Iqbal)

* unix: report errors for unpollable fds (Ben Noordhuis)

* win: fix watching root files (Nicholas Vavilov)

* build,win: print the Visual Studio version in use (Saúl Ibarra
  Corretgé)

* build,win: remove unneeded condition from GYP file (Saúl Ibarra
  Corretgé)

* test,win: fix compilation warning (Saúl Ibarra Corretgé)

* test: use uv_loop_close and assert its result (Nan Xiang)

* build: map 'AMD64' host arch to 'x64' (Ben Noordhuis)

* osx: protected use of potentially undefined macro (Samuel Lorétan)

* linux: fix compilation with musl (Saúl Ibarra Corretgé)

* doc: describe how to make release builds on Unix (Saúl Ibarra
  Corretgé)

* doc: add missing link in README (Saúl Ibarra Corretgé)

* build: python 2.x/3.x consistent print usage (Rasmus Christian
  Pedersen)

* test: assume no IPv6 if interfaces cannot be listed (Nan Xiang)

* darwin: replace F_FULLFSYNC with fdatasync syscall (Saúl Ibarra
  Corretgé)

* doc: add missing write callback to example (Nándor István Krácser)

* build: compile with -D_THREAD_SAFE on AIX (Imran Iqbal)

* test: fix threadpool_multiple_event_loops on PPC (Imran Iqbal)

* test: reduce timeout in tcp_close_while_connecting (Imran Iqbal)

* unix, win: consistently null-terminate buffers (Saúl Ibarra Corretgé)

* unix, win: count null byte on UV_ENOBUFS (Saúl Ibarra Corretgé)

* test: fix deadlocks in uv_cond_wait (Katsutoshi Horie)

* linux: fix cpu count (Lukasz Jagiello)

* unix: fix uv__handle_type for AIX (Imran Iqbal)

* linux: call fclose(), fix fdopen() memory leak (Ben Noordhuis)

* win: remove unneeded condition (Saúl Ibarra Corretgé)

* unix: fix compile error in Android using bionic (Robert Chiras)

* linux: add braces to multi-statement if (Kári Tristan Helgason)

* doc: add @cjihrig as a maintainer (Saúl Ibarra Corretgé)

* unix: add fork-safe open file function (Kári Tristan Helgason)

* linux: replace calls to fopen with uv__open_file (Kári Tristan
  Helgason)

* linux: remove redundant call to rewind() (Krishnaraj Bhat)

* win: remove duplicated code when processing fsevents (Saúl Ibarra
  Corretgé)

* test: fix poll_bad_fdtype for AIX (Imran Iqbal)

* linux: fix error checking in uv__open_file (Saúl Ibarra Corretgé)

* poll: add UV_DISCONNECT event (Santiago Gimeno)

* fs: realpath: fix string size before converting (Yuval Brik)

* win: use native APIs for UTF conversions (cjihrig)

* doc: clarify uv_loop_close() (Ben Noordhuis)

* unix: retry ioctl(TIOCGWINSZ) on EINTR (Ben Noordhuis)

* win,build: remove unused build defines (Saúl Ibarra Corretgé)

* win: fix buffer overflow in fs events (Joran Dirk Greef)

* win: fix uv_relative_path and remove dead branch (Joran Dirk Greef)

* unix: use open(2) with O_CLOEXEC on OS X (Kári Tristan Helgason)

* test: add missing copyright header (cjihrig)

* aix: fix 'POLLRDHUP undeclared' build error (Ben Noordhuis)

* unix,win: add uv_get_passwd() (cjihrig)

* process: fix uv_spawn edge-case (Santiago Gimeno)

* test: use %ld for printing uid/gid (Ben Noordhuis)

* aix: fix ahafs implementation (Imran Iqbal)

* aix: do not store absolute path to ahafs (Imran Iqbal)

* process: close process pipes safely (Santiago Gimeno)

* unix: open ttyname instead of /dev/tty (Enno Boland)

* unix: remove outdated comment (Kári Tristan Helgason)
2016-04-07 12:14:56 +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
cjihrig
f04d5fc3b9 win: use native APIs for UTF conversions
This commit replaces uv_utf16_to_utf8() and uv_utf8_to_utf16()
with calls to the native Windows API equivalents.

Refs: https://github.com/libuv/libuv/pull/672#discussion_r49049746
PR-URL: https://github.com/libuv/libuv/pull/762
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-18 12:40:57 -04: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
cjihrig
c0fa2e7518 unix,win: add uv_os_tmpdir()
PR-URL: https://github.com/libuv/libuv/pull/672
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-01-21 09:11:56 +01:00
Saúl Ibarra Corretgé
61f13a6d5e Now working on version 1.8.1 2015-12-14 21:07:52 +01:00
Saúl Ibarra Corretgé
5467299450 2015.12.15, Version 1.8.0 (Stable)
Changes since version 1.7.5:

* unix: fix memory leak in uv_interface_addresses (Jianghua Yang)

* unix: make uv_guess_handle work properly for AIX (Gireesh Punathil)

* fs: undo uv__req_init when uv__malloc failed (Jianghua Yang)

* build: remove unused 'component' GYP option (Saúl Ibarra Corretgé)

* include: remove duplicate extern declaration (Jianghua Yang)

* win: use the MSVC provided snprintf where possible (Jason Williams)

* win, test: fix compilation warning (Saúl Ibarra Corretgé)

* win: fix compilation with VS < 2012 (Ryan Johnston)

* stream: support empty uv_try_write on unix (Fedor Indutny)

* unix: fix request handle leak in uv__udp_send (Jianghua Yang)

* src: replace QUEUE_SPLIT with QUEUE_MOVE (Ben Noordhuis)

* unix: use QUEUE_MOVE when iterating over lists (Ben Noordhuis)

* unix: squelch harmless valgrind warning (Ben Noordhuis)

* test: don't abort on setrlimit() failure (Ben Noordhuis)

* unix: only undo fs req registration in async mode (Ben Noordhuis)

* unix: fix uv__getiovmax return value (HungMingWu)

* unix: make work with Solaris Studio. (Adam Stylinski)

* test: fix fs_event_watch_file_currentdir flakiness (Santiago Gimeno)

* unix: skip prohibited syscalls on tvOS and watchOS (Nathan Corvino)

* test: use FQDN in getaddrinfo_fail test (Wink Saville)

* docs: clarify documentation of uv_tcp_init_ex (Andrius Bentkus)

* win: fix comment (Miodrag Milanovic)

* doc: fix typo in README (Angel Leon)

* darwin: abort() if (un)locking fs mutex fails (Ben Noordhuis)

* pipe: enable inprocess uv_write2 on Windows (Louis DeJardin)

* win: properly return UV_EBADF when _close() fails (Nicholas Vavilov)

* test: skip process_title for AIX (Imran Iqbal)

* misc: expose handle print APIs (Petka Antonov)

* include: add stdio.h to uv.h (Saúl Ibarra Corretgé)

* misc: remove unnecessary null pointer checks (Ian Kronquist)

* test,freebsd: skip udp_dual_stack if not supported (Santiago Gimeno)

* linux: don't retry dup2/dup3 on EINTR (Ben Noordhuis)

* unix: don't retry dup2/dup3 on EINTR (Ben Noordhuis)

* test: fix -Wtautological-pointer-compare warnings (Saúl Ibarra
  Corretgé)

* win: map ERROR_BAD_PATHNAME to UV_ENOENT (Tony Kelman)

* test: fix test/test-tty.c for AIX (Imran Iqbal)

* android: support api level less than 21 (kkdaemon)

* fsevents: fix race on simultaneous init+close (Fedor Indutny)

* linux,fs: fix p{read,write}v with a 64bit offset (Saúl Ibarra
  Corretgé)

* fs: add uv_fs_realpath() (Yuval Brik)

* win: fix path for removed and renamed fs events (Joran Dirk Greef)

* win: do not read more from stream than available (Jeremy Whitlock)

* test: test that uv_close() doesn't corrupt QUEUE (Andrey Mazo)

* unix: fix uv_fs_event_stop() from fs_event_cb (Andrey Mazo)

* test: fix self-deadlocks in thread_rwlock_trylock (Ben Noordhuis)

* src: remove non ascii character (sztomi)

* test: fix test udp_multicast_join6 for AIX (Imran Iqbal)
2015-12-14 20:54:30 +01:00
Yuval Brik
e76b8838e5 fs: add uv_fs_realpath()
Equivalent to realpath(3), returns the full resolved absolute path of a
file or directory.

PR-URL: https://github.com/libuv/libuv/pull/531
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-12-05 11:32:58 +01:00
Saúl Ibarra Corretgé
f41b7386de include: add stdio.h to uv.h
Fixes a compilation problem in some platforms (notably OSX) after
6490c50.

PR-URL: https://github.com/libuv/libuv/pull/618
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremy Whitlock <jwhitlock@apache.org>
2015-11-17 09:14:01 +01:00
Petka Antonov
6490c508a9 misc: expose handle print APIs
PR-URL: https://github.com/libuv/libuv/pull/291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-11-16 09:34:34 +01:00
Jianghua Yang
e5c03aed6b include: remove duplicate extern declaration
PR-URL: https://github.com/libuv/libuv/pull/547
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-24 23:19:31 +02:00
Saúl Ibarra Corretgé
455c4035d4 Now working on version 1.7.6 2015-09-22 22:27:51 +02:00
Saúl Ibarra Corretgé
a8c1136de2 2015.09.23, Version 1.7.5 (Stable)
Changes since version 1.7.4:

* unix: Support atomic compare & swap xlC on AIX (nmushell)

* unix: Fix including uv-aix.h on AIX (nmushell)

* unix: consolidate rwlock tryrdlock trywrlock errors (Saúl Ibarra
  Corretgé)

* unix, win: consolidate mutex trylock errors (Saúl Ibarra Corretgé)

* darwin: fix memory leak in uv_cpu_info (Jianghua Yang)

* test: add tests for the uv_rwlock implementation (Bert Belder)

* win: redo/fix the uv_rwlock APIs (Bert Belder)

* win: don't fetch function pointers to SRWLock APIs (Bert Belder)
2015-09-22 22:12:07 +02:00
Bert Belder
9a4fd2689d win: redo/fix the uv_rwlock APIs
Previously, on Windows Vista and later, we'd use the Windows native
SRWLock APIs. However they turned out to be semantically incompatible
with pthread read-write locks and/or plain buggy. This patch makes sure
that the custom implementation that was previously only used on old
Windows versions is now used everywhere.

This patch fixes a number of issues with the old fallback
implementation. Specifically:

* The reader count would not be incremented when a thread successfully
  acquired a read lock while another thread *also* held a read lock.

* `uv_rwlock_tryrdlock()` and `uv_rwlock_trywrlock()` now
  consistently return UV_EBUSY when a lock couldn't be acquired.

* Any unexpected errors now cause libuv to abort, with the exception of
  `uv_rwlock_init()`.

See also https://github.com/libuv/libuv/issues/515.

PR-URL: https://github.com/libuv/libuv/pull/525
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-22 11:18:13 -04:00
Saúl Ibarra Corretgé
e2db9240db Working on the next version 2015-09-11 17:58:25 +02:00
Saúl Ibarra Corretgé
a7ad4f5218 2015.09.12, Version 1.7.4 (Stable)
Changes since version 1.7.3:

* doc: uv_read_start and uv_read_cb clarifications (Ben Trask)

* freebsd: obtain true uptime through clock_gettime() (Jianghua Yang)

* win, tty: do not convert \r to \r\n (Colin Snover)

* build,gyp: add DragonFly to the list of OSes (Michael Neumann)

* fs: fix bug in sendfile for DragonFly (Michael Neumann)

* doc: add uv_dlsym() return type (Brian White)

* tests: fix fs tests run w/o full getdents support (Jeremy Whitlock)

* doc: fix typo (Devchandra Meetei Leishangthem)

* doc: fix uv-unix.h location (Sakthipriyan Vairamani)

* unix: fix error check when closing process pipe fd (Ben Noordhuis)

* test,freebsd: fix ipc_listen_xx_write tests (Santiago Gimeno)

* win: fix unsavory rwlock fallback implementation (Bert Belder)

* doc: clarify repeat timer behavior (Eli Skeggs)
2015-09-11 17:44:02 +02:00
Bert Belder
3eb6764acd win: fix unsavory rwlock fallback implementation
Before this patch an uv_mutex_t (backed by a critical section) could be
released by a tread different from the thread that acquired it, which is
not allowed. This is fixed by using a semaphore instead.

Note that the affected code paths were used on Windows XP and Windows
Server 2003 only.

Fixes: https://github.com/libuv/libuv/issues/515
PR-URL: https://github.com/libuv/libuv/pull/516
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-11 06:05:32 +02:00
Saúl Ibarra Corretgé
93877b11c8 2015.08.28, Version 1.7.3 (Stable)
Changes since version 1.7.2:

* threadpool: fix thread starvation bug (Ben Noordhuis)
2015-08-27 23:42:36 +02:00
Saúl Ibarra Corretgé
4d13a013fc 2015.08.25, Version 1.7.2 (Stable)
Changes since version 1.7.1:

* unix, win: make uv_loop_init return on error (Willem Thiart)

* win: reset pipe handle for pipe servers (Saúl Ibarra Corretgé)

* win: fix replacing pipe handle for pipe servers (Saúl Ibarra Corretgé)

* win: fix setting pipe pending instances after bind (Saúl Ibarra
  Corretgé)
2015-08-24 23:26:27 +02:00
Saúl Ibarra Corretgé
44f4b6bd82 2015.08.20, Version 1.7.1 (Stable)
Changes since version 1.7.0:

* doc: document the procedure for verifying releases (Saúl Ibarra
  Corretgé)

* doc: add note about Windows binaries to the README (Saúl Ibarra
  Corretgé)

* doc: use long GPG IDs in MAINTAINERS.md (Saúl Ibarra Corretgé)

* Revert "stream: squelch ECONNRESET error if already closed" (Saúl
  Ibarra Corretgé)

* doc: clarify uv_read_stop() is idempotent (Corbin Simpson)

* unix: OpenBSD's setsockopt needs an unsigned char for multicast
  (Zachary Hamm)

* test: Fix two memory leaks (Karl Skomski)

* unix,win: return EINVAL on nullptr args in uv_fs_{read,write} (Karl
  Skomski)

* win: set accepted TCP sockets as non-inheritable (Saúl Ibarra
  Corretgé)

* unix: remove superfluous parentheses in fs macros (Ben Noordhuis)

* unix: don't copy arguments for sync fs requests (Ben Noordhuis)

* test: plug small memory leak in unix test runner (Ben Noordhuis)

* unix,windows: allow NULL loop for sync fs requests (Ben Noordhuis)

* unix,windows: don't assert on unknown error code (Ben Noordhuis)

* stream: retry write on EPROTOTYPE on OSX (Brian White)

* common: fix use of snprintf on Windows (Saúl Ibarra Corretgé)

* tests: refactored fs watch_dir tests for stability (Jeremy Whitlock)
2015-08-19 22:45:07 +02:00
Saúl Ibarra Corretgé
415a865d63 2015.08.06, Version 1.7.0 (Stable)
Changes since version 1.6.1:

* win,stream: add slot to remember CRT fd (Bert Belder)

* win,pipe: properly close when created from CRT fd (Bert Belder)

* win,pipe: don't close fd 0-2 (Bert Belder)

* win,tty: convert fd -> handle safely (Bert Belder)

* win,tty: properly close when created from CRT fd (Bert Belder)

* win,tty: don't close fd 0-2 (Bert Belder)

* win,fs: don't close fd 0-2 (Bert Belder)

* win: include "malloc.h" (Cheng Zhao)

* windows: MSVC 2015 has C99 inline (Jason Williams)

* dragonflybsd: fixes for nonblocking and cloexec (Michael Neumann)

* dragonflybsd: use sendfile(2) for uv_fs_sendfile (Michael Neumann)

* dragonflybsd: fix uv_exepath (Michael Neumann)

* win,fs: Fixes align(8) directive on mingw (Stefano Cristiano)

* unix, win: prevent replacing fd in uv_{udp,tcp,pipe}_t (Saúl Ibarra
  Corretgé)

* win: move logic to set socket non-inheritable to uv_tcp_set_socket
  (Saúl Ibarra Corretgé)

* unix, win: add ability to create tcp/udp sockets early (Saúl Ibarra
  Corretgé)

* test: retry select() on EINTR, honor milliseconds (Ben Noordhuis)

* unix: consolidate tcp and udp bind error (Saúl Ibarra Corretgé)

* test: conditionally skip udp_ipv6_multicast_join6 (heshamsafi)

* core: add UV_VERSION_HEX macro (Saúl Ibarra Corretgé)

* doc: add section with version-checking macros and functions (Saúl
  Ibarra Corretgé)

* tty: cleanup handle if uv_tty_init fails (Saúl Ibarra Corretgé)

* darwin: save a fd when FSEvents is used (Saúl Ibarra Corretgé)

* win: fix returning thread id in uv_thread_self (Saúl Ibarra Corretgé)

* common: use offsetof for QUEUE_DATA (Saúl Ibarra Corretgé)

* win: remove UV_HANDLE_CONNECTED (A. Hauptmann)

* docs: add Windows specific note for uv_fs_open (Saúl Ibarra Corretgé)

* doc: add note about uv_fs_scandir (Saúl Ibarra Corretgé)

* test,unix: reduce stack size of watchdog threads (Ben Noordhuis)

* win: add support for recursive file watching (Saúl Ibarra Corretgé)

* win,tty: support consoles with non-default colors (John McNamee)

* doc: add missing variable name (Yosuke Furukawa)

* stream: squelch ECONNRESET error if already closed (Santiago Gimeno)

* build: remove ancient condition from common.gypi (Saúl Ibarra
  Corretgé)

* tests: skip some tests when network is unreachable (Luca Bruno)

* build: proper support for android cross compilation (guworks)

* android: add missing include to pthread-fixes.c (RossBencina)

* test: fix compilation warning (Saúl Ibarra Corretgé)

* doc: add a note about uv_dirent_t.type (Saúl Ibarra Corretgé)

* win,test: fix shared library build (Saúl Ibarra Corretgé)

* test: fix compilation warning (Santiago Gimeno)

* build: add experimental Windows installer (Roger A. Light)

* threadpool: send signal only when queue is empty (chenttuuvv)

* aix: fix uv_exepath with relative paths (Richard Lau)

* build: fix version syntax in AppVeyor file (Saúl Ibarra Corretgé)

* unix: allow nbufs > IOV_MAX in uv_fs_{read,write} (ronkorving)
2015-08-05 22:10:09 +02:00
Saúl Ibarra Corretgé
ede94898aa core: add UV_VERSION_HEX macro
PR-URL: https://github.com/libuv/libuv/pull/412
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-29 23:08:41 +02:00
Saúl Ibarra Corretgé
f8f59824c4 unix, win: add ability to create tcp/udp sockets early
Introduce two new APIs:

int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, int flags)
int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, int flags)

The lower 8 bits of the flags field are used for the socket domain.
AF_INET, AF_INET6 and AF_UNSPEC are supported. If AF_UNSPEC is specified
the socket is created lazily, just like uv_{tcp,udp}_init.

Some Windows notes:

getsockname fails with WSAEINVAL if the socket is not bound. This could
potentially be improved by detecting the socket family and filling
the sockaddr_in/6 struct manually.

bind returns WSAEFAULT if we try to bind a socket to the wrong family.
Unix returns EINVAL.

PR-URL: https://github.com/libuv/libuv/pull/400
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-19 09:37:19 +02:00
Bert Belder
b6bf6d2d1f win,stream: add slot to remember CRT fd
Certain types of streams may be opened from a CRT file descriptor (as
opposed to a Windows HANDLE). In order to close the file descriptor
later, libuv must store the file descriptor used to open the stream.

PR-URL: https://github.com/libuv/libuv/pull/396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-06-14 16:22:17 -07:00
Saúl Ibarra Corretgé
30c8be07bb 2015.06.06, Version 1.6.1 (Stable)
Changes since version 1.6.0:

* unix: handle invalid _SC_GETPW_R_SIZE_MAX values (cjihrig)
2015-06-05 19:45:58 +02:00
Saúl Ibarra Corretgé
adfccad764 2015.06.04, Version 1.6.0 (Stable)
Changes since version 1.5.0:

* aix: fix setsockopt for multicast options (Michael)

* unix: don't block for io if any io handle is primed (Saúl Ibarra
  Corretgé)

* windows: MSVC 2015 has snprintf() (Rui Abreu Ferreira)

* windows: Add VS2015 support to vcbuild.bat (Jason Williams)

* doc: fix typo in tcp.rst (Igor Soarez)

* linux: work around epoll bug in kernels < 2.6.37 (Ben Noordhuis)

* unix,win: add uv_os_homedir() (cjihrig)

* stream: fix `select()` race condition (Fedor Indutny)

* unix: prevent infinite loop in uv__run_pending (Saúl Ibarra Corretgé)

* unix: make sure UDP send callbacks are asynchronous (Saúl Ibarra
  Corretgé)

* test: fix `platform_output` netmask printing. (Andrew Paprocki)

* aix: add ahafs autoconf detection and README notes (Andrew Paprocki)

* core: add ability to customize memory allocator (Saúl Ibarra Corretgé)
2015-06-03 21:32:57 +02:00
Saúl Ibarra Corretgé
bddd6a8489 core: add ability to customize memory allocator
This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus some changes by yours
truly.

Thanks @beevik and @mattsta for their work on this!

PR-URL: https://github.com/libuv/libuv/pull/368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-02 12:05:20 +02:00
cjihrig
a62c2d5928 unix,win: add uv_os_homedir()
PR-URL: https://github.com/libuv/libuv/pull/350
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-05-21 17:31:35 +02:00
Saúl Ibarra Corretgé
4e77f74c7b 2015.05.07, Version 1.5.0 (Stable)
Changes since version 1.4.2:

* doc: clarify that the thread pool primites are not thread safe
  (Andrius Bentkus)

* aix: always deregister closing fds from epoll (Michael)

* unix: fix glibc-2.20+ macro incompatibility (Massimiliano Torromeo)

* doc: add Sphinx plugin for generating links to man pages (Saúl Ibarra
  Corretgé)

* doc: link system and library calls to man pages (Saúl Ibarra Corretgé)

* doc: document uv_getnameinfo_t.{host|service} (Saúl Ibarra Corretgé)

* build: update the location of gyp (Stephen von Takach)

* win: name all anonymous structs and unions (TomCrypto)

* linux: work around epoll bug in kernels 3.10-3.19 (Ben Noordhuis)

* darwin: fix size calculation in select() fallback (Ole André Vadla
  Ravnås)

* solaris: fix setsockopt for multicast options (Julien Gilli)

* test: fix race condition in multithreaded test (Ben Noordhuis)

* doc: fix long lines in tty.rst (Ben Noordhuis)

* test: use UV_TTY_MODE_* values in tty test (Ben Noordhuis)

* unix: don't clobber errno in uv_tty_reset_mode() (Ben Noordhuis)

* unix: reject non-tty fds in uv_tty_init() (Ben Noordhuis)

* win: fix pipe blocking writes (Alexis Campailla)

* build: fix cross-compiling for iOS (Steven Kabbes)

* win: remove unnecessary malloc.h

* include: use `extern "c++"` for defining C++ code (Kazuho Oku)

* unix: reap child on execvp() failure (Ryan Phillips)

* windows: fix handle leak on EMFILE (Brian Green)

* test: fix tty_file, close handle if initialized (Saúl Ibarra Corretgé)

* doc: clarify what uv_*_open accepts (Saúl Ibarra Corretgé)

* doc: clarify that we don't maintain external doc resources (Saúl
  Ibarra Corretgé)

* build: add documentation for ninja support (Devchandra Meetei
  Leishangthem)

* doc: document uv_buf_t members (Corey Farrell)

* linux: fix epoll_pwait() fallback on arm64 (Ben Noordhuis)

* android: fix compilation warning (Saúl Ibarra Corretgé)

* unix: don't close the fds we just setup (Sam Roberts)

* test: spawn child replacing std{out,err} to stderr (Saúl Ibarra
  Corretgé)

* unix: fix swapping fds order in uv_spawn (Saúl Ibarra Corretgé)

* unix: fix potential bug if dup2 fails in uv_spawn (Saúl Ibarra
  Corretgé)

* test: remove LOG and LOGF variadic macros (Saúl Ibarra Corretgé)

* win: fix uv_fs_access on directories (Saúl Ibarra Corretgé)

* win: fix of double free in uv_uptime (Per Nilsson)

* unix: open "/dev/null" instead of "/" for emfile_fd (Alan Rogers)

* docs: add some missing words (Daryl Haresign)

* unix: clean up uv_fs_open() O_CLOEXEC logic (Ben Noordhuis)

* build: set SONAME for shared library in uv.gyp (Rui Abreu Ferreira)

* windows: define snprintf replacement as inline instead of static (Rui
  Abreu Ferreira)

* win: fix unlink of readonly files (João Reis)

* doc: fix uv_run(UV_RUN_DEFAULT) description (Ben Noordhuis)

* linux: intercept syscall when running under memory sanitizer (Keno
  Fischer)

* aix: fix uv_interface_addresses return value (farblue68)

* windows: defer reporting TCP write failure until next tick (Saúl
  Ibarra Corretgé)

* test: add test for deferred TCP write failure (Saúl Ibarra Corretgé)
2015-05-06 21:48:15 +02:00
Saúl Ibarra Corretgé
1f711e4d6d Revert "memory: add uv_replace_allocator"
This reverts commit c272f1f1bc.

The concept will come back to libuv, but it needs some more work.
2015-04-29 09:37:02 +02:00
Kazuho Oku
252f3624c2 include: use extern "c++" for defining C++ code
PR-URL: https://github.com/libuv/libuv/pull/265
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-18 09:40:51 +01:00
Brett Vickers
c272f1f1bc memory: add uv_replace_allocator
With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-05 20:02:16 +01:00
TomCrypto
073323baca win: name all anonymous structs and unions
All the public structs and unions in the private fields in uv-win.h have
been named and all code accessing them updated, to comply to the C89
spec (which were previously causing warnings with the -pedantic flag).

PR-URL: https://github.com/libuv/libuv/pull/239
Reviewed-By: Andrius Bentkus <andrius.bentkus@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-04 09:35:10 +01:00
Saúl Ibarra Corretgé
8ef34592a9 doc: document uv_getnameinfo_t.{host|service}
Fixes: https://github.com/libuv/libuv/issues/182
PR-URL: https://github.com/libuv/libuv/pull/233
Reviewed-By: Tim Caswell <tim@creationix.com>
2015-03-02 16:53:57 +01:00
Saúl Ibarra Corretgé
1a7391348a 2015.02.27, Version 1.4.2 (Stable)
Changes since version 1.4.1:

* stream: ignore EINVAL for SO_OOBINLINE on OS X (Fedor Indutny)
2015-02-26 11:20:00 +01:00
Saúl Ibarra Corretgé
e8e3fc5789 2015.02.25, Version 1.4.1 (Stable)
Changes since version 1.4.0:

* win: don't use inline keyword in thread.c (Ben Noordhuis)

* windows: fix setting dirent types on uv_fs_scandir_next (Saúl Ibarra
  Corretgé)

* unix,windows: make uv_thread_create() return errno (Ben Noordhuis)

* tty: fix build for SmartOS (Julien Gilli)

* unix: fix for uv_async data race (Michael Penick)

* unix, windows: map EHOSTDOWN errno (Ben Noordhuis)

* stream: use SO_OOBINLINE on OS X (Fedor Indutny)
2015-02-24 20:45:46 +01:00
Ben Noordhuis
3f910a0196 unix, windows: map EHOSTDOWN errno
Fixes: https://github.com/libuv/libuv/issues/195
PR-URL: https://github.com/libuv/libuv/pull/212
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-19 15:38:12 +01:00
Saúl Ibarra Corretgé
3ddfb4a9cc windows: fix setting dirent types on uv_fs_scandir_next
Also make the tests more strict.

PR-URL: https://github.com/libuv/libuv/pull/201
Reviewed-By: Tim Caswell <tim@creationix.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-02-12 09:05:48 +01:00
Saúl Ibarra Corretgé
19fb8a9064 2015.02.10, Version 1.4.0 (Stable)
Changes since version 1.3.0:

* unix: check Android support for pthread_cond_timedwait_monotonic_np
  (Leith Bade)

* test: use modified path in test (cjihrig)

* unix: implement uv_stream_set_blocking() (Ben Noordhuis)
2015-02-09 21:06:37 +01:00
Saúl Ibarra Corretgé
165685b2a9 2015.01.29, Version 1.3.0 (Stable)
Changes since version 1.2.1:

* unix, windows: set non-block mode in uv_poll_init (Saúl Ibarra
  Corretgé)

* doc: clarify which flags are supported in uv_fs_event_start (Saúl
  Ibarra Corretgé)

* win,unix: move loop functions which have identical implementations
  (Andrius Bentkus)

* doc: explain how the threadpool is allocated (Alex Mo)

* doc: clarify uv_default_loop (Saúl Ibarra Corretgé)

* unix: fix implicit declaration compiler warning (Ben Noordhuis)

* unix: fix long line introduced in commit 94e628fa (Ben Noordhuis)

* unix, win: add synchronous uv_get{addr,name}info (Saúl Ibarra
  Corretgé)

* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)

* build: compile -D_GNU_SOURCE on linux (Ben Noordhuis)

* build: use -fvisibility=hidden in autotools build (Ben Noordhuis)

* fs, pipe: no trailing terminator in exact sized buffers (Andrius
  Bentkus)

* style: rename buf to buffer and len to size for consistency (Andrius
  Bentkus)

* test: fix test-spawn on MinGW32 (Luis Martinez de Bartolome)

* win, pipe: fix assertion when destroying timer (Andrius Bentkus)

* win, unix: add pipe_peername implementation (Andrius Bentkus)
2015-01-28 21:54:27 +01:00
Andrius Bentkus
39a0936fec win, unix: add pipe_peername implementation
PR-URL: https://github.com/libuv/libuv/pull/166
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-28 21:40:32 +01:00
Andrius Bentkus
2bfa2e5e22 style: rename buf to buffer and len to size for consistency
PR-URL: https://github.com/libuv/libuv/pull/159
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-27 11:31:16 +01:00
Saúl Ibarra Corretgé
f2bb8d394c unix, win: add synchronous uv_get{addr,name}info
PR-URL: https://github.com/libuv/libuv/pull/156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-23 01:12:05 +01:00
Saúl Ibarra Corretgé
4ca78e9890 2015.01.15, Version 1.2.1 (Stable)
Changes since version 1.2.0:

* unix: remove unused dtrace file (Saúl Ibarra Corretgé)

* test: skip TTY select test if /dev/tty can't be opened (Saúl Ibarra
  Corretgé)

* doc: clarify the behavior of uv_tty_init (Saúl Ibarra Corretgé)

* doc: clarify how uv_async_send behaves (Saúl Ibarra Corretgé)

* build: make dist now generates a full tarball (Johan Bergström)

* freebsd: make uv_exepath more resilient (Saúl Ibarra Corretgé)

* unix: make setting the tty mode to the same value a no-op (Saúl Ibarra
  Corretgé)

* win,tcp: support uv_try_write (Bert Belder)

* test: enable test-tcp-try-write on windows (Bert Belder)

* win,tty: support uv_try_write (Bert Belder)

* unix: set non-block mode in uv_{pipe,tcp,udp}_open (Ben Noordhuis)
2015-01-14 19:52:26 +01:00
Saúl Ibarra Corretgé
09f25b13cd 2015.01.06, Version 1.2.0 (Stable)
Changes since version 1.1.0:

* linux: fix epoll_pwait() sigmask size calculation (Ben Noordhuis)

* tty: implement binary I/O terminal mode (Yuri D'Elia)

* test: fix spawn test with autotools build (Ben Noordhuis)

* test: skip ipv6 tests when ipv6 is not supported (Ben Noordhuis)

* common: move STATIC_ASSERT to uv-common.h (Alexey Melnichuk)

* win/thread: store thread handle in a TLS slot (Alexey Melnichuk)

* unix: fix ttl, multicast ttl and loop options on IPv6 (Saúl Ibarra
  Corretgé)

* linux: fix support for preadv/pwritev-less kernels (Ben Noordhuis)

* unix: make uv_exepath(size=0) return UV_EINVAL (Ben Noordhuis)

* darwin: fix uv_exepath(smallbuf) UV_EPERM error (Ben Noordhuis)

* openbsd: fix uv_exepath(smallbuf) UV_EINVAL error (Ben Noordhuis)

* linux: fix uv_exepath(size=1) UV_EINVAL error (Ben Noordhuis)

* sunos: preemptively fix uv_exepath(size=1) (Ben Noordhuis)

* win: fix and clarify comments in winapi.h (Bert Belder)

* win: make available NtQueryDirectoryFile (Bert Belder)

* win: add definitions for directory information types (Bert Belder)

* win: use NtQueryDirectoryFile to implement uv_fs_scandir (Bert Belder)

* unix: don't unlink unix socket on bind error (Ben Noordhuis)

* build: fix bad comment in autogen.sh (Ben Noordhuis)

* build: add AC_PROG_LIBTOOL to configure.ac (Ben Noordhuis)

* test: skip udp_options6 if there no IPv6 support (Saúl Ibarra
  Corretgé)

* win: add definitions for MUI errors mingw lacks (Bert Belder)

* build: enable warnings in autotools build (Ben Noordhuis)

* build: remove -Wno-dollar-in-identifier-extension (Ben Noordhuis)

* build: move flags from Makefile.am to configure.ac (Ben Noordhuis)
2015-01-05 20:28:35 +01:00
Yuri D'Elia
025602da13 tty: implement binary I/O terminal mode
Introduce a uv_tty_mode_t enum for uv_tty_set_mode(), with backward
compatible values.  Add a new mode UV_TTY_MODE_IO, which uses
cfmakeraw() internally.

PR-URL: https://github.com/libuv/libuv/pull/86
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-12-27 18:18:24 +01:00
Saúl Ibarra Corretgé
a6d3d5a0f5 2014.12.25, Version 1.1.0 (Stable)
Changes since version 1.0.2:

* test: test that closing a poll handle doesn't corrupt the stack (Bert
  Belder)

* win: fix compilation of tests (Marc Schlaich)

* Revert "win: keep a reference to AFD_POLL_INFO in cancel poll" (Bert
  Belder)

* win: avoid stack corruption when closing a poll handle (Bert Belder)

* test: fix test-fs-file-loop on Windows (Bert Belder)

* test: fix test-cwd-and-chdir (Bert Belder)

* doc: indicate what version uv_loop_configure was added on (Saúl Ibarra
  Corretgé)

* doc: fix sphinx warning (Saúl Ibarra Corretgé)

* test: skip spawn_setuid_setgid if we get EACCES (Saúl Ibarra Corretgé)

* test: silence some Clang warnings (Saúl Ibarra Corretgé)

* test: relax osx_select_many_fds (Saúl Ibarra Corretgé)

* test: fix compilation warnings when building with Clang (Saúl Ibarra
  Corretgé)

* win: fix autotools build of tests (Luis Lavena)

* gitignore: ignore Visual Studio files (Marc Schlaich)

* win: set fallback message if FormatMessage fails (Marc Schlaich)

* win: fall back to default language in uv_dlerror (Marc Schlaich)

* test: improve compatibility for dlerror test (Marc Schlaich)

* test: check dlerror is "no error" in no error case (Marc Schlaich)

* unix: change uv_cwd not to return a trailing slash (Saúl Ibarra
  Corretgé)

* test: fix cwd_and_chdir test on Unix (Saúl Ibarra Corretgé)

* test: add uv_cwd output to platform_output test (Saúl Ibarra Corretgé)

* build: fix dragonflybsd autotools build (John Marino)

* win: scandir use 'ls' for formatting long strings (Kenneth Perry)

* build: remove clang and gcc_version gyp defines (Ben Noordhuis)

* unix, windows: don't treat uv_run_mode as a bitmask (Saúl Ibarra
  Corretgé)

* unix, windows: fix UV_RUN_ONCE mode if progress was made (Saúl Ibarra
  Corretgé)
2014-12-24 09:03:51 +01:00
Bert Belder
9f3fa71cfa Merge branch 'v0.10' into v1.x
Conflicts:
	src/win/poll.c
	test/test-poll-close-doesnt-corrupt-stack.c
2014-12-10 16:58:01 +01:00
Bert Belder
152c35d54d Revert "win: keep a reference to AFD_POLL_INFO in cancel poll"
The offending patch doesn't completely fix the issue, it just trades
stack corruption for heap corruption which is less likely.

In addition there is a much simpler solution for this problem.

This reverts commit cd894521dd.

PR-URL: https://github.com/libuv/libuv/pull/49
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Marc Schlaich <marc.schlaich@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-12-10 16:44:28 +01:00
Saúl Ibarra Corretgé
d42630dd9b 2014.12.10, Version 1.0.2 (Stable)
Changes since version 1.0.1:

* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis)

* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller)

* doc: fix spelling (Joey Geralnik)

* unix, windows: fix typos in comments (Joey Geralnik)

* test: canonicalize test runner path (Ben Noordhuis)

* test: fix compilation warnings (Saúl Ibarra Corretgé)

* test: skip tty test if detected width and height are 0 (Saúl Ibarra
  Corretgé)

* doc: update README with IRC channel (Saúl Ibarra Corretgé)

* Revert "unix: use cfmakeraw() for setting raw TTY mode" (Ben
  Noordhuis)

* doc: document how to get result of uv_fs_mkdtemp (Tim Caswell)

* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis)

* unix, windows: add uv_loop_configure() function (Ben Noordhuis)

* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich)

* test: raise fd limit for OSX select test (Saúl Ibarra Corretgé)

* unix: remove overzealous assert in uv_read_stop (Saúl Ibarra Corretgé)

* unix: reset the reading flag when a stream gets EOF (Saúl Ibarra
  Corretgé)

* unix: stop reading if an error is produced (Saúl Ibarra Corretgé)

* cleanup: remove all dead assignments (Maciej Małecki)

* linux: return early if we have no interfaces (Maciej Małecki)

* cleanup: remove a dead increment (Maciej Małecki)
2014-12-09 20:17:06 +01:00
Saúl Ibarra Corretgé
7d144851b5 Merge branch 'v0.10' into v1.x
Conflicts:
	AUTHORS
	ChangeLog
	src/version.c
	src/win/poll.c
2014-12-09 19:58:38 +01:00
schlamar
cd894521dd win: keep a reference to AFD_POLL_INFO in cancel poll 2014-12-09 08:49:59 +01:00
Ben Noordhuis
a6f2a4f834 Merge branch 'v0.10' into v1.x
Conflicts:
	AUTHORS
	ChangeLog
	README.md
	config-unix.mk
	include/uv.h
	src/unix/internal.h
	src/unix/kqueue.c
	src/unix/linux-core.c
	src/unix/stream.c
	src/uv-common.c
	src/uv-common.h
	src/version.c
	test/test-osx-select.c
2014-12-05 19:18:36 +01:00
Ben Noordhuis
9da5fd443e unix, windows: add uv_loop_configure() function
The only supported option right now is UV_LOOP_BLOCK_SIGNAL, which only
supports the SIGPROF signal and only on UNIX platforms.  So yes, it is
kind of limited right now.  But everything has to start somewhere.

Refs strongloop/strong-agent#3 and strongloop-internal/scrum-cs#37.

PR-URL: https://github.com/libuv/libuv/pull/15
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-12-05 17:39:43 +01:00
Bert Belder
0a8e81374e 2014.11.27, Version 1.0.1 (Stable)
Changes since version 1.0.0:

* readme: remove Rust from users (Elijah Andrews)

* doc,build,include: update project links (Ben Noordhuis)

* doc: fix typo: Strcutures -> Structures (Michael Ira Krufky)

* unix: fix processing process handles queue (Saúl Ibarra Corretgé)

* win: replace non-ansi characters in source file (Bert Belder)
2014-11-26 21:31:41 +01:00
Ben Noordhuis
7ce1113885 doc,build,include: update project links
The project home has moved from https://github.com/joyent/libuv to
https://github.com/libuv/libuv.  Update the links inside the repo.
2014-11-25 15:39:12 +01:00
Saúl Ibarra Corretgé
feb2a9e694 2014.11.21, Version 1.0.0 (Stable)
Changes since version 1.0.0-rc2:

* doc: fix git/svn url for gyp repo in README (Emmanuel Odeke)

* windows: fix fs_read with nbufs > 1 and offset (Unknown W. Brackets)

* win: add missing IP_ADAPTER_UNICAST_ADDRESS_LH definition for MinGW
  (huxingyi)

* doc: mention homebrew in README (Mikhail Mukovnikov)

* doc: add learnuv workshop to README (Thorsten Lorenz)

* doc: fix parameter name in uv_fs_access (Saúl Ibarra Corretgé)

* unix: use cfmakeraw() for setting raw TTY mode (Yuri D'Elia)

* win: fix uv_thread_self() (Alexis Campailla)

* build: add x32 support to gyp build (Ben Noordhuis)

* build: remove dtrace probes (Ben Noordhuis)

* doc: fix link in misc.rst (Manos Nikolaidis)

* mailmap: remove duplicated entries (Saúl Ibarra Corretgé)

* gyp: fix comment regarding version info location (Saúl Ibarra
  Corretgé)
2014-11-20 19:34:12 +01:00
Saúl Ibarra Corretgé
e03c0c7383 doc: fix parameter name in uv_fs_access
Closes #1560
2014-11-06 21:14:57 -05:00
Saúl Ibarra Corretgé
f277e80707 version: now working on 1.0.0-rc3 2014-10-20 22:50:40 +02:00
Saúl Ibarra Corretgé
e3ea6c1179 2014.10.21, Version 1.0.0-rc2 (Pre-release)
Changes since version 1.0.0-rc1:

* build: add missing fixtures to distribution tarball (Rob Adams)

* doc: update references to current stable branch (Zachary Newman)

* fs: fix readdir on empty directory (Fedor Indutny)

* fs: rename uv_fs_readdir to uv_fs_scandir (Saúl Ibarra Corretgé)

* doc: document uv_alloc_cb (Saúl Ibarra Corretgé)

* doc: add migration guide from version 0.10 (Saúl Ibarra Corretgé)

* build: add DragonFly BSD support in autotools (Robin Hahling)

* doc: document missing stream related structures (Saúl Ibarra Corretgé)

* doc: clarify uv_loop_t.data field lifetime (Saúl Ibarra Corretgé)

* doc: add documentation for missing functions and structures (Saúl
  Ibarra Corretgé)

* doc: fix punctuation and grammar in README (Jeff Widman)

* windows: return libuv error codes in uv_poll_init() (cjihrig)

* unix, windows: add uv_fs_access() (cjihrig)

* windows: fix netmask detection (Alexis Campailla)

* unix, windows: don't include null byte in uv_cwd size (Saúl Ibarra
  Corretgé)

* unix, windows: add uv_thread_equal (Tomasz Kołodziejski)

* windows: fix fs_write with nbufs > 1 and offset (Unknown W. Brackets)
2014-10-20 22:47:56 +02:00
Tomasz Kołodziejski
59658a8de7 unix, windows: add uv_thread_equal 2014-10-20 09:51:49 +02:00
cjihrig
c18205a1c5 unix, windows: add uv_fs_access() 2014-10-13 10:23:53 +02:00
Saúl Ibarra Corretgé
03e53f1cf7 fs: rename uv_fs_readdir to uv_fs_scandir
Closes #1431
2014-09-25 10:09:58 +02:00
Saúl Ibarra Corretgé
01293ac03a version: now working on 1.0.0-rc2 2014-09-18 18:48:09 +02:00
Saúl Ibarra Corretgé
0c28bbf7b4 version: set version to 1.0.0-rc1 2014-09-18 18:13:53 +02:00
Alexis Campailla
6ced8c2cc7 windows: improve timer precision
Improve timing precision by using QueryPerformanceCounter.

This is part of the fix for Node.js' test-timers-first-fire.js.
2014-09-17 23:17:41 +02:00
Saúl Ibarra Corretgé
f70b3fae8b version: add ability to specify a version suffix 2014-09-11 20:58:41 +02:00
Saúl Ibarra Corretgé
1cc5f179f5 include: cleanup uv.h
Remove comments describing the API which are now part of the
documentation, thus avoiding future comment rot (and removing the
existing part).
2014-09-11 09:38:35 +02:00
Saúl Ibarra Corretgé
2d5eaea1cd unix: simplify how process handle queue is managed 2014-09-04 10:06:52 +02:00
mattn
ae6197d730 windows: remove duplicated field
Fixes build
2014-09-03 18:42:46 +02:00
Saúl Ibarra Corretgé
06f9e1438e core: add a reserved field to uv_handle_t and uv_req_t
Just in case we need to work hard in keeping ABI compatibility.
2014-08-29 13:27:53 +02:00
Saúl Ibarra Corretgé
e524f89beb core: update version to 1.0.0 2014-08-29 10:31:50 +02:00
Saúl Ibarra Corretgé
4ca9a36389 unix, windows: add uv_fileno
Returns the platform specific file descriptor for handles that are
backed by one. The datatype is abstracted as uv_os_fd_t, which maps to
int on Unices and HANDLE on Windows.

Users can use this function to set specific socket options, for example,
in a non portable way.

This function is essentially a shotgun, you better be careful with
whatever you do with it, don't blame me if you used it to get the fd of
a stream, close it yourself and expect things to Just Work.
2014-08-27 10:53:40 +02:00
Saúl Ibarra Corretgé
df8ab507a0 fs: extend reported types in uv_fs_readdir_next
Support all possible types on Unix, and files, directories and links on
Windows. Some systems (hello SunOS!) don't have the d_type field on struct
dirent, so mark them as UV_DIRENT_UNKNOWN.
2014-08-15 16:44:44 +02:00
Fedor Indutny
ab2c4425a5 fs: introduce uv_readdir_next() and report types
Introduce:

    int uv_fs_readdir_next(uv_fs_t* req, uv_dirent_t* ent);

`uv_fs_readdir()` is not returning a file names list in `req->ptr`
anymore, the proper way to gather them is to call `uv_fs_readdir_next()`
in a callback.
2014-08-14 17:19:45 +04:00
Pavel Platto
a669f21bf8 windows: use OpenBSD implementation for uv_fs_mkdtemp 2014-08-12 10:04:09 +02:00
Leonard Hecker
4c90cc8e14 unix: fix typedef of uv_buf_t
Typedefs of unnamed structs cannot be forward declared.
Giving the uv_buf_t struct a name makes forward declarations possible.
2014-08-10 17:30:13 +02:00
huxingyi
ca4741b4a5 windows: fix build on MinGW 2014-08-10 12:09:04 +02:00
Andrius Bentkus
0ecee213ea unix, windows: add uv_recv_buffer_size and uv_send_buffer_size 2014-08-09 11:36:35 +02:00
Jameson Nash
837c62c71b windows: make uv_read_stop immediately stop reading
This implements locking around the blocking call to ReadFile to get
around a Windows kernel bug where a blocking ReadFile operation on a
stream can deadlock the thread. This allows uv_read_stop to immediately
cancel a pending IO operation, and allows uv_pipe_getsockname to
"pause" any pending read (from libuv) while it retrieves the
sockname information.

If unsupported by the OS (pre-Vista), this reverts to the old
(e.g. deadlock-prone) behavior

Closes #1313
2014-08-09 11:10:57 +02:00
Saúl Ibarra Corretgé
02e1ebd40b include: remove unneeded EADDRINFO errno
EADDRINFO is not a readl errno, it was used to signal any error that
getaddrinfo would return, but we return actual errors now.
2014-08-07 21:24:55 +02:00
Saúl Ibarra Corretgé
a9a4872c29 Now working on v0.11.29 2014-08-07 12:21:41 +02:00
Saúl Ibarra Corretgé
fc9e2a0bc4 2014.08.08, Version 0.11.28 (Unstable)
Changes since version 0.11.27:

* unix, windows: const-ify handle in uv_udp_getsockname (Rasmus
  Pedersen)

* windows: use UV_ECANCELED for aborted TCP writes (Saúl Ibarra
  Corretgé)

* windows: add more required environment variables (Jameson Nash)

* windows: sort environment variables before calling CreateProcess
  (Jameson Nash)

* unix, windows: move uv_loop_close out of assert (John Firebaugh)

* windows: fix buffer overflow on uv__getnameinfo_work() (lilohuang)

* windows: add uv_backend_timeout (Jameson Nash)

* test: disable tcp_close_accept on Windows (Saúl Ibarra Corretgé)

* windows: read the PATH env var of the child (Alex Crichton)

* include: avoid using C++ 'template' reserved word (Iñaki Baz Castillo)

* include: fix version number (Saúl Ibarra Corretgé)
2014-08-07 12:18:10 +02:00
Saúl Ibarra Corretgé
6bcb799a0d include: fix version number 2014-08-07 12:17:06 +02:00
Iñaki Baz Castillo
a1ff22cb7e include: avoid using C++ 'template' reserved word
Closes #1394
2014-08-06 12:52:46 +02:00
Rasmus Christian Pedersen
e72d48ddab unix, windows: const-ify handle in uv_udp_getsockname 2014-07-31 22:27:36 +02:00
Alexis Campailla
6d3a051eb4 windows: relay TCP bind errors via ipc
This is the libuv side of the fix for Node's cluster module on Windows.
https://github.com/joyent/node/issues/7691

Windows and Unix return certain socket errors (i.e. EADDRINUSE) at
different times: bind on Windows, and listen on Unix.
In an effort to hide this difference, libuv on Windows stores such
errors in the bind_error field of uv_tcp_t, to defer raising it at
listen time.
This worked fine except for the case in which a socket is shared in
a Node cluster and a bind error occurs.

A previous attempt to fix this (
d1e6be1460
3da36fe00e
) was flawed becaused in an attempt to relay the error at the JS level
it caused the master to start accepting connections.

With this new approach, libuv itself is relaying the bind errors,
providing for a uniform behavior of uv_tcp_listen.
2014-07-31 17:24:40 +02:00
Pavel Platto
e99b89f2ad unix, windows: add uv_fs_mkdtemp 2014-07-31 09:43:55 +02:00
Andrew Low
cdc979dbe0 aix: improve AIX compatibility 2014-07-22 22:57:24 +02:00
Graham Lee
dc1ea27c73 doc: clarify the return value of uv_default_loop 2014-07-13 11:23:08 +02:00
Iñaki Baz Castillo
bf6e90f4d6 doc: cleanup API documentation in uv.h 2014-07-06 22:33:15 +02:00
mattn
b17223cd60 build: fix build on MinGW32 2014-07-06 20:40:59 +02:00
Andrius Bentkus
b9b386ac5a doc: grammar, udp documentation fix up 2014-07-05 11:23:48 +02:00
Saúl Ibarra Corretgé
40ad12e5be unix: return UV_EAGAIN if uv_try_write cannot write any data 2014-07-04 20:45:09 +02:00
Andrius Bentkus
0d43992c3b unix, win: add uv_udp_try_send
The function returns UV_EAGAIN if the queue is not empty and
the message couldn't be sent immediately.
2014-07-04 18:30:33 +02:00
Andrius Bentkus
b769484ca3 unix, win: add send_queue_size and send_queue_count to uv_udp_t
This functionality is present in stream and uv_udp_t has a queue
as well so it makes sense for udp to have a send_write_size.
Since udp sends entire messages atomically, the send_queue_count field
lets the user determine how many messages are there left to send.
2014-07-04 18:28:18 +02:00
Andrius Bentkus
d17bfc617e doc: add documentation to uv_udp_start_recv 2014-07-02 18:49:06 +02:00
Saúl Ibarra Corretgé
4bace4d67c unix: use struct sockaddr_storage for target UDP addr 2014-06-29 23:52:46 +02:00
Saúl Ibarra Corretgé
8d11aacb79 unix, windows: use the same threadpool implementation 2014-06-27 14:27:04 +02:00
Tim Cooper
546fa7d508 doc: remove duplicate word 2014-06-27 08:16:53 +02:00
Fedor Indutny
4661f2d6c0
Now working on v0.11.27 2014-06-27 04:41:02 +04:00
Fedor Indutny
115281a105
2014.06.28, Version 0.11.26 (Unstable)
Changes since version 0.11.25:

* windows: add VT100 codes ?25l and ?25h (JD Ballard)

* windows: add invert ANSI (7 / 27) emulation (JD Ballard)

* unix: fix handling error on UDP socket creation (Saúl Ibarra Corretgé)

* unix, windows: getnameinfo implementation (Rasmus Pedersen)

* heap: fix `heap_remove()` (Fedor Indutny)

* unix, windows: fix parsing scoped IPv6 addresses (Saúl Ibarra
  Corretgé)

* windows: fix handling closed socket while poll handle is closing (Saúl
  Ibarra Corretgé)

* thread: barrier functions (Ben Noordhuis)

* windows: fix PYTHON environment variable usage (Jay Satiro)

* unix, windows: return system error on EAI_SYSTEM (Saúl Ibarra
  Corretgé)

* windows: fix handling closed socket while poll handle is closing (Saúl
  Ibarra Corretgé)

* unix: don't run i/o callbacks after prepare callbacks (Saúl Ibarra
  Corretgé)

* windows: add tty unicode support for input (Peter Atashian)

* header: introduce `uv_loop_size()` (Andrius Bentkus)

* darwin: invoke `mach_timebase_info` only once (Fedor Indutny)
2014-06-27 04:40:57 +04:00
Saúl Ibarra Corretgé
d4c1228d15 include: const-ify arguments to uv_getnameinfo_cb 2014-06-26 22:46:39 +02:00
Saúl Ibarra Corretgé
029e1273b8 unix: define NI_MAXHOST and NI_MAXSERV if needed
OSX only exposes them if _POSIX_C_SOURCE is not defined, for instance.
2014-06-24 10:20:43 +02:00
Andrius Bentkus
e392a1af4d header: introduce uv_loop_size()
We add a function called uv_loop_size which returns the size of
the loop. It is an additional function which complements
`uv_handle_size` and` uv_req_size` in order to provide full FFI
support.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-24 08:47:17 +04:00
Saúl Ibarra Corretgé
a098ac66dd unix, windows: return system error on EAI_SYSTEM 2014-06-16 10:09:45 +02:00
Ben Noordhuis
b64c359557 include: document barrier functions
Add some basic doc comments to the uv_barrier_*() functions and document
the "serializer" return value from the previous commit.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-07 07:57:09 -07:00
Ben Noordhuis
91985d48f6 unix, windows: make uv_barrier_wait() return bool
Make uv_barrier_wait() return a boolean value indicating whether this
thread was the "serializer".

From `man pthread_barrier_wait`:

    Upon successful completion, the pthread_barrier_wait() function
    shall return PTHREAD_BARRIER_SERIAL_THREAD for a single (arbitrary)
    thread synchronized at the barrier and zero for each of the other
    threads.

Exposing that information from libuv is useful because it can make
cleanup significantly easier:

    if (uv_barrier_wait(&barrier) > 0)
      uv_barrier_destroy(&barrier);

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-07 07:57:08 -07:00
Saúl Ibarra Corretgé
aab8d9dab4 doc: clarify return value when UV_RUN_NOWAIT is used
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-05-25 23:39:40 +02:00
Rasmus Christian Pedersen
70c42563c1 unix, windows: getnameinfo implementation
Closes #852
2014-05-20 17:33:52 +02:00
Rasmus Christian Pedersen
ecaede660c unix, windows: uv_dlerror const argument 2014-05-13 00:00:54 +02:00
Saúl Ibarra Corretgé
fa0e1e5071 unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
Trevor Norris
32597100b8 thread: add uv_thread_cb typedef
To keep with convention, add a typedef for the function called that
initializes the new thread.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-02 01:33:13 +04:00
Timothy J Fontaine
b5548f18c9 Now working on v0.11.26 2014-05-01 09:16:48 -07:00
Timothy J Fontaine
2acd544cff 2014.05.02, Version 0.11.25 (Unstable)
Changes since version 0.11.24:

* osx: pass const handle pointer to uv___stream_fd (Chernyshev
  Viacheslav)

* unix, windows: pass const handle ptr to uv_tcp_get*name (Chernyshev
  Viacheslav)

* common: pass const sockaddr ptr to uv_ip*_name (Chernyshev Viacheslav)

* unix, windows: validate flags on uv_udp|tcp_bind (Saúl Ibarra
  Corretgé)

* unix: handle case when addr is not initialized after recvmsg (Saúl
  Ibarra Corretgé)

* unix, windows: uv_now constness (Rasmus Pedersen)
2014-05-01 09:16:45 -07:00
Rasmus Christian Pedersen
87ae69b638 unix, windows: uv_now constness
uv_now doesnt require modification of uv_loop_t as such argument is
changed to a const uv_loop_t* as this more in spirit with remaining
API in libuv.
2014-04-29 19:39:13 -03:00
Saúl Ibarra Corretgé
76eb7518c6 doc: clarify what the addr argument of uv_udp_recv_cb contains 2014-04-23 19:28:30 +02:00
Saúl Ibarra Corretgé
d86d86633e doc: clarify uv_try_write return values 2014-04-22 08:41:16 +02:00
Chernyshev Viacheslav
20d092edc8 common: pass const sockaddr ptr to uv_ip*_name
uv_ip4_name and uv_ip6_name do not modify passed sockaddr pointer,
so there is no need to keep this parameter non-const.
2014-04-18 12:07:38 +02:00
Chernyshev Viacheslav
886e2bcd55 unix, windows: pass const handle ptr to uv_tcp_get*name
uv_tcp_getsockname and uv_tcp_getpeername do not modify passed handle
pointer, so there is no need to keep this parameter non-const.
2014-04-18 12:07:38 +02:00
Trevor Norris
f212ceffae include: reorder UV_HANDLE_PRIVATE_FIELDS
The fields for UV_HANDLE_PRIVATE_FIELDS in uv-win.h and uv-unix.h are
the same, but in different order. Simply swap them so uv_handle_t are
the same on both platforms.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-17 14:31:23 +04:00
Timothy J Fontaine
1daff47ae9 Now working on v0.11.25 2014-04-14 09:56:52 -07:00
Timothy J Fontaine
ed948c29f6 2014.04.15, Version 0.11.24 (Unstable)
Changes since version 0.11.23:

* linux: reduce file descriptor count of async pipe (Ben Noordhuis)

* sunos: support IPv6 qualified link-local addresses (Saúl Ibarra
  Corretgé)

* windows: fix opening of read-only stdin pipes (Alexis Campailla)

* windows: Fix an infinite loop in uv_spawn (Alex Crichton)

* windows: fix console signal handler refcount (李港平)

* inet: allow scopeid in uv_inet_pton (Fedor Indutny)

* win: always leave crit section in get_proc_title (Fedor Indutny)
2014-04-14 09:56:49 -07:00
Fedor Indutny
6a657dcbee include: add reserved field for #926
Introduce reserved field to be able to fix #926 after v0.12 release.
2014-04-14 20:44:49 +04:00
Saúl Ibarra Corretgé
2c02c4ee1e sunos: support IPv6 qualified link-local addresses 2014-04-09 19:40:01 +02:00
Fedor Indutny
842c70c5c5
Now working on v0.11.24
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-07 15:39:10 +04:00
Fedor Indutny
e54de537ef
2014.04.07, Version 0.11.23 (Unstable)
Changes since version 0.11.22:

* fs: avoid using readv/writev where possible (Fedor Indutny)

* mingw: fix build with autotools (Saúl Ibarra Corretgé)

* bsd: support IPv6 qualified link-local addresses (Saúl Ibarra Corretgé)

* unix: add UV_HANDLE_IPV6 flag to tcp and udp handles (Saúl Ibarra Corretgé)

* unix, windows: do not set SO_REUSEADDR by default on udp (Saúl Ibarra
  Corretgé)

* windows: fix check in uv_tty_endgame() (Maks Naumov)

* unix, windows: add IPv6 support for uv_udp_multicast_interface (Saúl Ibarra
  Corretgé)

* unix: fallback to blocking writes if reopening a tty fails (Saúl Ibarra
  Corretgé)

* unix: fix handling uv__open_cloexec failure (Saúl Ibarra Corretgé)

* unix, windows: add IPv6 support to uv_udp_set_membership (Saúl Ibarra
  Corretgé)

* unix, windows: removed unused status parameter (Saúl Ibarra Corretgé)

* android: add support of ifaddrs in android (Javier Hernández)

* build: fix SunOS and AIX build with autotools (Saúl Ibarra Corretgé)

* build: freebsd link with libelf if dtrace enabled (Saúl Ibarra Corretgé)

* stream: do not leak `alloc_cb` buffers on error (Fedor Indutny)

* unix: fix setting written size on uv_wd (Saúl Ibarra Corretgé)

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-07 15:38:27 +04:00
Fedor Indutny
7d5ac7b9cc Merge branch 'v0.10'
Conflicts:
	include/uv.h
	src/unix/error.c
2014-04-03 17:04:32 +04:00
Fedor Indutny
295882ed32 error: add EMLINK mapping
fix joyent/node#7307
2014-04-03 16:37:25 +04:00
Saúl Ibarra Corretgé
e89740a957 bsd: support IPv6 qualified link-local addresses 2014-04-02 01:27:01 +02:00
Saúl Ibarra Corretgé
3558d65d2f unix, windows: do not set SO_REUSEADDR by default on udp
Add UV_UDP_REUSEADDR flag instead, which can be passed to uv_udp_bind.
If the udp handle is unbound when uv_udp_set_memberhsip or
uv_udp_set_multicast_interface is called, the handle will be bound with
UV_UDP_REUSEADDR set.
2014-04-02 01:21:35 +02:00
Saúl Ibarra Corretgé
db2a9072bc unix, windows: removed unused status parameter
async, timer, prepare, idle and check handles don't need the status
parameter.
2014-03-17 21:42:36 +01:00
Javier Hernández
a2506c9362 android: add support of ifaddrs in android
Fixes https://github.com/joyent/node/issues/7291
2014-03-16 23:16:25 +01:00
Timothy J Fontaine
1dc2709b99 Now working on v0.11.23 2014-03-10 16:58:32 -07:00
Timothy J Fontaine
cd0c19b1d3 2014.03.11, Version 0.11.22 (Unstable)
Changes since version 0.11.21:

* unix, windows: map ERANGE errno (Saúl Ibarra Corretgé)

* unix, windows: make uv_cwd be consistent with uv_exepath (Saúl Ibarra
  Corretgé)

* process: remove debug perror() prints (Fedor Indutny)

* windows: fall back for volume info query (Isaiah Norton)

* pipe: allow queueing pending handles (Fedor Indutny)

* windows: fix winsock status codes for address errors (Raul Martins)

* windows: Remove unused variable from uv__pipe_insert_pending_socket
  (David Capello)

* unix: workaround broken pthread_sigmask on Android (Paul Tan)

* error: add ENXIO for O_NONBLOCK FIFO open() (Fedor Indutny)

* freebsd: use accept4, introduced in version 10 (Saúl Ibarra Corretgé)

* windows: fix warnings of MinGW -Wall -O3 (StarWing)

* openbsd, osx: fix compilation warning on scandir (Saúl Ibarra
  Corretgé)

* linux: always deregister closing fds from epoll (Geoffry Song)

* unix: reopen tty as /dev/tty (Saúl Ibarra Corretgé)

* kqueue: invalidate fd in uv_fs_event_t (Fedor Indutny)
2014-03-10 16:54:33 -07:00
Fedor Indutny
9aa48312bc Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	include/uv.h
	src/unix/error.c
	src/unix/process.c
	src/version.c
2014-03-06 20:45:15 +04:00
Fedor Indutny
4f72f2145b error: add ENXIO for O_NONBLOCK FIFO open()
When opening FIFO with `O_NONBLOCK` flag, `ENXIO` could be returned if
the readable side hasn't yet opened this FIFO.
2014-03-06 20:36:07 +04:00
Paul Tan
347000929d unix: workaround broken pthread_sigmask on Android
On android, if a call to `pthread_sigmask` fails with EINVAL, fallback
to `sigprocmask`. This workarounds the broken behaviour of
`pthread_sigmask` on Android versions < 4.1. See:

* https://android.googlesource.com/platform/bionic/+/9bf330b5
* https://code.google.com/p/android/issues/detail?id=15337

This is implemented by replacing all calls of `pthread_sigmask` to a new
function `uv__pthread_sigmask` which implements this fallback mechanism.
2014-03-06 11:54:50 +01:00
Fedor Indutny
b05a3ee4d1 pipe: allow queueing pending handles
Introduce `int uv_pipe_pending_count(uv_pipe_t*)` and
`uv_handle_type uv_pipe_pending_type(uv_pipe_t*)`. They should be
used in IPC pipe's read cb to accept incoming handles:

    int count = uv_pipe_pending_count(pipe);
    int i;
    for (i = 0; i < count; i++) {
      uv_handle_type type = uv_pipe_pending_type(pipe);
      /* ... */
      uv_accept(...);
    }
2014-03-04 00:34:29 +04:00
Saúl Ibarra Corretgé
422d2810b3 unix, windows: make uv_cwd be consistent with uv_exepath
Fixes #446
2014-02-27 09:44:28 +01:00
Timothy J Fontaine
649dfc3037 Now working on v0.11.22 2014-02-26 18:04:24 -08:00
Timothy J Fontaine
3ef958158a 2014.02.28, Version 0.11.21 (Unstable)
Changes since version 0.11.20:

* unix: fix uv_fs_write when using an empty buffer (Saúl Ibarra
  Corretgé)

* unix, windows: add assertion in uv_loop_delete (Saúl Ibarra Corretgé)
2014-02-26 18:04:23 -08:00
Timothy J Fontaine
2cfb96e9e2 src: bump the version number
There was a bug in the libuv release tool where it didn't properly
update the proper version file.
2014-02-26 17:53:01 -08:00
Saúl Ibarra Corretgé
b055538d09 unix, windows: clarify what uv_stream_set_blocking does
Also replace the assert with an error on unix.
2014-02-26 00:03:30 +01:00
Saúl Ibarra Corretgé
7ad8f74302 unix, windows: set required size on UV_ENOBUFS
When the supplied buffer is not big enough and UV_ENOBUFS is
returned, hint the user about the required size by setting
the len paramemeter to the required value.

Applies to:
- uv_pipe_getsockname
- uv_fs_event_getpath
- uv_fs_poll_getpath
2014-02-25 11:56:02 +01:00
Saúl Ibarra Corretgé
6f98f4efd1 unix, windows: map ERANGE errno
This is a backport of 2f58bb6 from the master branch
2014-02-25 10:48:26 +01:00
Saúl Ibarra Corretgé
2f58bb6018 unix, windows: map ERANGE errno 2014-02-25 09:51:44 +01:00