This improves API consistency with uv_read and uv_write and may
improve efficiency for some uses. Vectored IO is emulated when the
requisite system calls are unavailable.
The unix implementation of uv_spawn always starts out with a
uv__handle_init, but the windows implementation sometimes bails out
early before calling uv__handle_init. This means that uv_close on a
failed uv_spawn will always succeed on unix but sometimes fail on
windows.
This commit lifts the initialization of the uv_process_t above all of
the error checking to ensure that uv_close will always work when
uv_spawn returns an error.
The crtdbg.h header was added in c0716b3d, but MinGW does not have this
header present on the system. This commit takes the same approach of
2684f876a and just ignores this header and functionality on MinGW
Without this, running vcbuild repeatedly for some time will cause errors with msbuild saying the command line is too long (due to concatenation happening in vcvarsall).
Signals don't exist on Windows, but libuv emulates the behaviour of
several Unix signals. This wasn't documented, and the existing
documentation for signal reception emulation on Windows was worded as if
it applied to signal sending, which it does not.
Every file descriptor opened using libuv should be automatically marked
as CLOEXEC to prevent it from leaking to a child process. Note that
since we are opening fds in a thread pool, there is a possible race
condition between `uv_spawn()` and the `open()` + `uv__cloexec()`. The
rwlock was added to avoid it.
see https://github.com/joyent/node/issues/6905
getaddrinfo_fail can sometimes take slightly longer than the default
timeout of 5000. Set its timeout to 10000 to compensate, but leave the
timeout of all other tests at the default.
Add a single TEST_ENTRY_CUSTOM hook that can be used to override task
entry defaults. Different tests can have different timeouts depending on
what is appropriate for each test. A separate TEST_OUTPUT_ENTRY hook is
no longer necessary.
In order to support per-task timeouts, the timeout field has been moved
into the task_entry_t struct. The default (5000) is now set as part of
TEST_ENTRY.
Changed the order of the member assignments since the thread
may start before the parameters are assigned. This especially
happens when the osx scheduler is very busy.
Changes since version 0.11.17:
* osx: Fix a possible segfault in uv__io_poll (Alex Crichton)
* windows: improved handling of invalid FDs (Alexis Campailla)
* doc: adding ARCHS flag to OS X build command (Nathan Sweet)
* tcp: reveal bind-time errors before listen (Alexis Campailla)
* tcp: uv_tcp_dualstack() (Fedor Indutny)
* linux: relax assumption on /proc/stat parsing (Luca Bruno)
* openbsd: fix obvious bug in uv_cpu_info (Fedor Indutny)
* process: close stdio after dup2'ing it (Fedor Indutny)
* linux: move sscanf() out of the assert() (Trevor Norris)
When building using gyp and BUILDTYPE=Release using clang 3.4 received
this warning:
../src/unix/linux-core.c:640:34: warning: variable 'n' is uninitialized
for (len = sizeof("cpu0"); n /= 10; len++);
^
Initializing n = 0 silences this build warning.
Changes since version 0.10.22:
* linux: relax assumption on /proc/stat parsing (Luca Bruno)
* openbsd: fix obvious bug in uv_cpu_info (Fedor Indutny)
* process: close stdio after dup2'ing it (Fedor Indutny)
Thus allow passing the same file descriptor as the source of multiple
stdios.
Committed with the help and code parts from:
* Sam Roberts <sam@strongloop.com>
fix#1074
CPU entries in /proc/stat are not guaranteed to be monotonically
increasing, asserting on this assumption can break in cases such
as the UltraSparc II machine shown in #1080.
Signed-off-by: Luca Bruno <lucab@debian.org>
Changed uv_tcp_duplicate_socket to reveal any bind-time errors
before calling listen().
This fix is 100% windows specific.
It helps fix Node.js unite test test-cluster-bind-twice on Windows.
Adding further instructions about building for OS X, as recent versions
of xcodebuild will automatically build for i386 (can someone say,
"monoculture") even on x86_64 machines! Specifically including
instructions about including the "ARCHS" flag to specify the right
architecture.
This is trivial, but will save people time.
If passed and invalid FD, _get_osfhandle() sets an error code
through errno, not _doserrno. Hence we need to use
SET_REQ_WIN32_ERROR insted of SET_REQ_RESULT.
In debug builds, _get_osfhandle() also raises a superfluous
assert. I implemented a wrapper that disables all asserts
around the call to _get_osfhandle().
This fixes node.js unit tests test-fs-read-stream.js and
test-listen-fd-ebadf.js.