include: use x macros for uv_any_{handle,req} unions
Generate the members of the uv_any_handle and uv_any_req unions with the UV_HANDLE_TYPE_MAP and UV_REQ_TYPE_MAP macros. Eases maintenance when new handle or request types are added.
unix: getaddrinfo_cb status arg should be 0 or -1
The documentation in uv.h states that the status argument to the uv_getaddrinfo() callback is either 0 or -1 but uv-unix actually passed it the addrinfo error code. Rectify that and add a regression test. Fixes #754.
unix, windows: remove ngx-queue.h
Avoids an extra #include in public headers and stops the ngx_queue_* types and macros from leaking into user code.
include: remove UV_VERSION_* macros
Superseded by uv_version() and uv_version_string().
sunos: fix syntax error introduced in 76d831e
Moving around the code for #754 inadvertently introduced a syntax error in a SunOS-only code path. The syntax error didn't actually manifest at build time because the #elif it was wrapped in was, alas, wrong as well.
include: updated uv_udp_open documentation
On Unix, uv_udp_open can be used with any socket as long as the socket follows the datagram contract (works in unconnected mode, supports sendmsg()/recvmsg(), etc.). This means that any datagram-socket, like for example netlink or raw sockets, can be used with libuv. Added this information to the documentation.
unix, win: add netmask to uv_interface_address
Include the netmask when returning information about the OS network interfaces. This commit provides implementations for windows and those unix platforms using getifaddrs(). AIX was not implemented because it requires the use of ioctls and I do not have an AIX development/test environment. The windows code was developed using mingw on winxp as I do not have access to visual studio. Tested on darwin (ipv4/ipv6) and winxp (ipv4 only). Needs testing on newer windows using ipv6 and other unix platforms.
2013.04.11, Version 0.11.1 (Unstable)
This is the first versioned release from the current unstable libuv branch. Changes since Node.js v0.11.0: * all platforms: nanosecond resolution support for uv_fs_[fl]stat (Timothy J. Fontaine) * all platforms: add netmask to uv_interface_address (Ben Kelly) * unix: make sure the `status` parameter passed to the `uv_getaddrinfo` is 0 or -1 (Ben Noordhuis) * unix: limit the number of iovecs written in a single `writev` syscall to IOV_MAX (Fedor Indutny) * unix: add dtrace probes for tick-start and tick-stop (Timothy J. Fontaine) * mingw-w64: don't call _set_invalid_parameter_handler (Nils Maier) * windows: fix memory leak in fs__sendfile (Shannen Saez) * windows: fix edge case bugs in uv_cpu_info (Bert Belder) * include: no longer ship with / include ngx-queue.h (Ben Noordhuis) * include: remove UV_VERSION_* macros from uv.h (Ben Noordhuis) * documentation updates (Kristian Evensen, Ben Kelly, Ben Noordhuis) * build: fix dtrace-enabled builds (Ben Noordhuis, Timothy J. Fontaine) * build: gyp disable thin archives (Timothy J. Fontaine) * build: add support for Visual Studio 2012 (Nicholas Vavilov)
darwin: look up file path with F_GETPATH
Look up the file path with fcntl(F_GETPATH) and pass it to the uv_fs_event_cb callback.
build: avoid double / in paths for dtrace
GYP doesn't resolve or normalize the paths, resulting in the action not firing if the path contains // so take care to avoid that
unix: remove src/unix/cygwin.c
The cygwin build has been broken for a long time now and no one is complaining, which strongly suggests that no one actually uses it. Remove it.
windows: deal with the fact that GetTickCount might lag
We use GetQueuedCompletionStatus(Ex) to sleep the thread until the next timer expires (provided that no other events happen before that). However after waking up from a sleep the GetTickCount() return value may not immediately reflect that some time has passed. This happens because gqcs can sometimes sleep for periods shorter than the GetTickCount clock resulution. This patch changes time tracking so the amount of time waited by gqcs is taken into account. This has the following advantages: * Excessive loop iterations are avoided. * Small timeouts are fired more precisely. * The `loop-stop` test that used to be flaky on Windows now passes consistently.
Merge remote-tracking branch 'origin/v0.10'
Conflicts: ChangeLog src/version.c
sunos: handle disabled watcher after callback
Fix a potential use-after-free bug where the uv__io watcher struct is referenced after being disabled by its callback function. The stress is on 'potential' because in practice the watcher's memory is not released until the next tick of the event loop.
2013.05.11, Version 0.11.2 (Unstable)
Changes since version 0.11.1: * darwin: look up file path with F_GETPATH (Ben Noordhuis) * unix, windows: add uv_has_ref() function (Saúl Ibarra Corretgé) * build: avoid double / in paths for dtrace (Timothy J. Fontaine) * unix: remove src/unix/cygwin.c (Ben Noordhuis) * windows: deal with the fact that GetTickCount might lag (Bert Belder) * unix: silence STATIC_ASSERT compiler warnings (Ben Noordhuis) * linux: don't use fopen() in uv_resident_set_memory() (Ben Noordhuis)
unix: remove errno preserving code
Remove the errno preserving code. Libuv only implemented it in a haphazard way and there seems to be a general consensus that no one really cares anyway. Therefore, remove it.
Conflicts: ChangeLog config-unix.mk src/version.c
2013.05.16, Version 0.11.3 (Unstable)
Changes since version 0.11.2: * unix: clean up uv_accept() (Ben Noordhuis) * unix: remove errno preserving code (Ben Noordhuis) * darwin: fix ios build, don't require ApplicationServices (Ben Noordhuis) * windows: kill child processes when the parent dies (Bert Belder) * build: set soname in shared library (Ben Noordhuis) * build: make `make test` link against .a again (Ben Noordhuis) * build: only set soname on shared object builds (Timothy J. Fontaine) * build: convert predefined $PLATFORM to lower case (Elliot Saba) * test: fix process_title failing on linux (Miroslav Bajtoš) * test, sunos: disable process_title test (Miroslav Bajtoš) * test: add error logging to tty unit test (Miroslav Bajtoš)
unix: appease warning about non-standard inline
Clang warns about using `inline`, which is not technically allowed in C89 mode (libuv compiles with `-std=c89`). It's probably best to leave it to the compiler to do the inlining anyway.
windows: call idle handles on every loop iteration
This mimicks what the unix implementation does: call idle handles on every loop iteration. The guarantee that it runs on every loop iteration makes it easier to predict and opens up more use cases. Note that the name uv_idle is now a bit of a misnomer. There is actually no guarantee that libuv completely processed all i/o when an iteration ends. The windows implementation at least limits the amount of callbacks processed in a single iteration to avoid some handles getting a disproportionate amount of cpu attention.
test: reflect new idle semantics in test
Update the `idle_starvation` test to verify not only that idle callbacks are called, but also that they are called once per loop iteration.
Merge remote-tracking branch 'origin/v0.10'
Conflicts: ChangeLog src/unix/stream.c src/version.c
unix, windows: run expired timers in run-once mode
Before this commit, creating an event loop, starting a timer and calling uv_run(UV_RUN_ONCE) blocked in uv_run() until the timer expired - but didn't actually run the timer.
2013.05.30, Version 0.11.4 (Unstable)
Changes since version 0.11.3: * windows: make uv_spawn not fail when the libuv embedding application is run under external job control (Bert Belder) * darwin: assume CFRunLoopStop() isn't thread-safe, fixing a race condition when stopping the 'stdin select hack' thread (Fedor Indutny) * win: fix UV_EALREADY not being reported correctly to the libuv user in some cases (Bert Belder) * darwin: make the uv__cf_loop_runner and uv__cf_loop_cb functions static (Ben Noordhuis) * darwin: task_info() cannot fail (Ben Noordhuis) * unix: add error mapping for ENETDOWN (Ben Noordhuis) * unix: implicitly signal write errors to the libuv user (Ben Noordhuis) * unix: fix assertion error on signal pipe overflow (Bert Belder) * unix: turn off POLLOUT after stream connect (Ben Noordhuis) * unix: fix stream refcounting buglet (Ben Noordhuis) * unix: remove assert statements that are no longer correct (Ben Noordhuis) * unix: appease warning about non-standard `inline` (Sean Silva) * unix: add uv__is_closing() macro (Ben Noordhuis) * unix: stop stream POLLOUT watcher on write error (Ben Noordhuis) * include: document uv_update_time() and uv_now() (Ben Noordhuis) * linux: fix cpu model parsing on newer arm kernels (Ben Noordhuis) * linux: fix a memory leak in uv_cpu_info() error path (Ben Noordhuis) * linux: don't ignore out-of-memory errors in uv_cpu_info() (Ben Noordhuis) * unix, windows: move uv_now() to uv-common.c (Ben Noordhuis) * test: fix a compilation problem in test-osx-select.c that was caused by the use of c-style comments (Bert Belder) * darwin: use uv_fs_sendfile() use the sendfile api correctly (Wynn Wilkes) * windows: call idle handles on every loop iteration, something the unix implementation already did (Bert Belder) * test: update the idle-starvation test to verify that idle handles are called in every loop iteration (Bert Belder) * unix, windows: ensure that uv_run() in RUN_ONCE mode calls timers that expire after blocking (Ben Noordhuis)