No longer explictly check wheter an IPv6 stack is present when the user
tries to use IPV6 sockets. Instead realy on the operating system
to report the lack of protocol support via appropriate error messages.
This patch makes uv_udp_set_socket responsible for setting the
UV_HANDLE_IPV6 flag. It also fixes the problem that uv_udp_open would
never set this flag at all.
In addition, this patch fixes some minor style issues.
This makes uv_tcp_set_socket responsible for setting the UV_HANDLE_IPV6
flag. This fixes a couple of situations where the the fact that a socket
is an IPv6 socket is not taken into account when deciding whether a call
to SetFileCompletionNotificationModes is appropriate.
It also fixes the issue that uv_tcp_open would never set this flag at
all.
uv_winsock_init() tries to create an IPv4 socket in order to detect
if the system has any layered service providers (LSPs) installed.
When creating this socket failed it would call uv_fatal_error and exit
with the following message:
socket: (10047) An address incompatible with the requested protocol was used.
This patch fixes that. It also includes some minor style tweaks.
Travis CI was generating a lot of false positives (or rather, false
negatives - tests that fail due to the environment they run in) and
it's been in a continuous error state for days now.
Remove it, we'll set up something ourselves.
Don't export _POSIX_C_SOURCE to dependents. On the BSDs (and the
BSD-ish, like OS X), it hides SysV and BSD definitions.
The exception is Linux: _POSIX_C_SOURCE=200112 unlocks some of the
newer pthreads features like spinlocks and barriers, so keep
exporting it on that platform.
The fallback added in 9d4a16e uses the /proc filesystem to emulate
utimensat().
Translate error codes that indicate no procfs is mounted to ENOSYS.
Letting those error codes through unchecked will only confuse callers.
This changes the prototype of uv_run() from:
int uv_run(uv_loop_t* loop);
To:
int uv_run(uv_loop_t* loop, uv_run_mode mode);
Where `mode` is UV_RUN_DEFAULT, UV_RUN_ONCE or UV_RUN_NOWAIT.
Fixes#683.
It makes the assumption that if you try to write to a localhost socket
often enough, eventually its send queue will fill up - which doesn't
happen if the machine it's running on is fast enough.
On i386, it does not need packing; it's 12 bytes packed or unpacked.
On ARM, it's actively harmful: the struct is 12 bytes when packed and
16 bytes when unpacked.
uv_guess_handle is currently squelching both fifo and all
sockets on to the UV_NAMED_PIPE type. Rather than treating
all sockets as UV_NAMED_PIPE, use getsockopt() and
getsockaddr() to determine if the socket is an AF_UNIX
stream (in which case return UV_NAMED_PIPE), or an AF_INET
stream (in which case return UV_TCP), or an AF_INET datagram
socket (in which case return UV_UDP).
Additionally, currently all other file descriptor types are
squelched to the UV_FILE type. Instead, only file descriptors
that are marked as regular files are treated as UV_FILE. All
other types (such as directories, character and block devices)
are now treated as UV_UNKNOWN_HANDLE.
Replace `void f()` with `void f(void)`; the former means "a function
that takes any number of arguments, including none" while the latter
is what is actually intended: a function taking no arguments.
The first form also isn't strictly conforming ANSI/ISO C.
`#if FOO` (where FOO is undefined) is a legal construct in C89 and C99
but gcc, clang and sparse complain loudly about it at higher warning
levels.
Squelch those warnings. Makes the code more consistent as well.