* Make uv_stop() work when libuv is embedded in another event loop.
* Fix a small bug where loop->stop_flag was not reset when mode ==
UV_RUN_ONCE or UV_RUN_NOWAIT. The next call to uv_run() would return
immediately without doing any work.
The sendfile emulation in src/unix/fs.c polls the file descriptor for
write readiness. If POLLERR or POLLHUP is set, it bails out but doesn't
set errno (hence it doesn't report a useful error code). Rectify that.
Fixes#620.
Make changes to the process title visible to tools like `ps`.
The argv clobber technique is reasonably portable across Unices;
the common code has been moved into src/unix/proctitle.c and is used
on Linux and OS X. Other platforms will probably follow in the future.
Don't add the io watcher to the watcher queue if the requested change
is effectively a no-op, that is, when the event mask doesn't change.
The exception here is sunos because the event ports backend requires
that watched file descriptors are re-added on every turn of the event
loop.
This commit is a micro-optimization, it does not change the event
loop's observable behavior in any way.
Before this commit, it was assumed that connect() on UNIX sockets never
returns EINPROGRESS. It turned out to be a bad assumption: Dave Pacheco
reports sporadic hangups on SmartOS because of that.
It's not clear to me _why_ the Illumos kernel returns that error but
that's inconsequential: whatever the cause, libuv needs to handle it
and now it does.
Fixesjoyent/node#4785.
Don't check the return value of epoll_ctl(EPOLL_CTL_DEL). When the
file descriptor is closed, we're potentially racing with another
thread and that means the errno is not a reliable indicator of
the actual error.
The other event mechanisms (kqueue, event ports) are not affected
because:
* kqueue returns either EBADF or ENOENT. Both are handled by libuv.
* event ports rearms all file descriptors on each call to port_getn().
Fixesjoyent/node#4558.
Make the statbuf field public. This means you no longer have to use
req->ptr - though that still works and will continue to work for the
foreseeable future.
Fixes#704.
Merge the OS X specific implementation of uv_cond_timedwait() with the
generic one. The only difference is that it now uses mach_absolute_time
instead of gettimeofday.
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.
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.
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.