This allows writing and reading any amount of buffers,
regardless of what IOV_MAX may be defined as.
It also moves the IOV_MAX test from stream to core.
This is based on the excellent work of @bwijen in #269.
Refs: https://github.com/libuv/libuv/pull/269
PR-URL: https://github.com/libuv/libuv/pull/448
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
uv_exepath() was not behaving correctly on AIX when the process was
invoked with a relative path.
The logic has been reworked to:
1) Use getargs() to retrieve the process arguments
2) Use realpath() to handle absolute and relative paths and
symbolic links
3) Check that a match when searching the PATH is executable (if
not search will continue)
PR-URL: https://github.com/libuv/libuv/pull/464
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Uses AppVeyor. Buidlds will be manually triggered when a tag is created
and uploaded to dist.libuv.org by a maintainer.
Refs: https://github.com/libuv/libuv/pull/359
PR-URL: https://github.com/libuv/libuv/pull/449
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
file_prefix_in_subdir is only used in Windows and OSX. Fixes the
following warning, which shows up with Clang:
test/test-fs-event.c:40:19: warning: unused variable
'file_prefix_in_subdir' [-Wunused-const-variable]
static const char file_prefix_in_subdir[] = "subdir";
PR-URL: https://github.com/libuv/libuv/pull/450
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Ifdef out the tests that rely on internal symbols when making a shared build.
PR-URL: https://github.com/libuv/libuv/pull/444
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The build script needs to properly specify the target as android
so the gyp build scripts can properly leverage cross compilation
using the android NDK.
PR-URL: https://github.com/libuv/libuv/pull/433
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Do not hard-fail network tests when libuv is built on
an isolated host/container.
Signed-off-by: Luca Bruno <lucab@debian.org>
PR-URL: https://github.com/libuv/libuv/pull/437
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Add new UV__POLLRDHUP event to be emitted when EPOLLRDHUP(in Linux) or
EV_EOF(in BSD / OSX) is detected and only if UV_READABLE is set.
When a read returns ECONNRESET after a UV__POLLRDHUP event, emit EOF instead
of the error.
Add tcp-squelch-connreset test. Not to be run on Windows as it returns
ECONNRESET error.
Fixes in test-poll and test-tcp-open so they pass after these changes.
PR-URL: https://github.com/libuv/libuv/pull/403
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Use the console text color set by the user rather than assuming the
Windows default (white foreground on black background).
PR-URL: https://github.com/libuv/libuv/pull/431
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Some 32 bits architectures, linux/mips and linux/mipsel in particular,
suffer from address space fragmentation when spawning many threads
with the default 8 MB stack size. The watchdog threads don't need
much stack space, all they do is sleep until the monitored process
exits, so lower it to 256 kB.
Fixes: https://github.com/libuv/libuv/issues/408
PR-URL: https://github.com/libuv/libuv/pull/429
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
UV_HANDLE_CONNECTED was defined, but never used anywhere - outside this if
condition inside uv__stdio_create. So this test can't be true.
UV_HANDLE_CONNECTION was meant.
A test was also added verifying the behaviour.
PR-URL: https://github.com/libuv/libuv/pull/404
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Silences the following runtime errors when compiling UBSan:
../src/unix/linux-core.c:181:9: runtime error: member access within null
pointer of type 'uv__io_t' (aka 'struct uv__io_s')
../src/unix/process.c:67:15: runtime error: member access within null
pointer of type 'uv_process_t' (aka 'struct uv_process_s')
../src/unix/process.c:91:15: runtime error: member access within null
pointer of type 'uv_process_t' (aka 'struct uv_process_s')
...
PR-URL: https://github.com/libuv/libuv/pull/422
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Once we are past uv__stream_init, the handle has been added to
loop->handle_queue, it needs to be undone in case of failure.
PR-URL: https://github.com/libuv/libuv/pull/414
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
OSX, other BSDs and SunoS fail with EAFNOSUPPORT when binding a socket created
with AF_INET to an AF_INET6 address or vice versa.
PR-URL: https://github.com/libuv/libuv/pull/407
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Make the test runner code that waits for other processes to terminate
retry the select() system call on EINTR and take elapsed time into
account.
A small side effect of this change is that millisecond timeout values
are now honored.
PR-URL: https://github.com/libuv/libuv/pull/410
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
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>
This fixes a bug I have noticed with nodejs:
> cat test.js
console.log(process.execPath);
> node test.js (on DragonFly)
node test.js
> node test.js (on Linux)
node
PR-URL: https://github.com/libuv/libuv/pull/399
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Use the same code path as FreeBSD does.
PR-URL: https://github.com/libuv/libuv/pull/399
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Prior to MSVC 2015, the standard C99 `inline` keyword was missing,
added a compiler version check and disabled the inline replacement for
MSVC >= 2015 in test/task.h.
Refs: https://github.com/libuv/libuv/pull/341
PR-URL: https://github.com/libuv/libuv/pull/369
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
As stated in malloc's docs[1], the malloc.h is required for using the
malloc function, and from malloc.h's source code (which can be found
under installed VS), malloc is defined as a macro that has different
behaviors under different configurations.
So using malloc without including malloc.h is very dangerous, for
certain build configurations crashes can happen when writing to memory
allocated by malloc.
[1]: https://msdn.microsoft.com/en-us/library/6ewkz86d.aspx
PR-URL: https://github.com/libuv/libuv/pull/395
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
When a Windows handle was opened from a CRT fd, it needs to be closed
with `close()` instead of `CloseHandle()`.
PR-URL: https://github.com/libuv/libuv/pull/396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
_get_osfhandle() may throw if it's used to convert a non-open file
descriptor to a Windows HANDLE. Use the safe uv__get_osfhandle instead.
PR-URL: https://github.com/libuv/libuv/pull/396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
When a Windows handle was opened from a CRT fd, it needs to be closed
with `close()` instead of `CloseHandle()`.
PR-URL: https://github.com/libuv/libuv/pull/396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>