This patch creates a new header - ev-proto.h - which contains all of the
protoypes for libev functions. This allows us to create a shared object of
libuv without exposing libev internal functions.
This reverts commit 5da380a5ca.
Contains a bug that effectively makes the select() thread busy-loop. The file
descriptor is polled for both reading and writing, regardless of what events
the main thread wants to receive. Fixing that requires proper synchronization
between the two threads.
See #614.
This reverts commit 31f9fbce63.
The reverted commit depends on commit 5da380a ("use select() for specific fds
on OS X") which polls /dev/tty file descriptors in a separate thread to work
around deficiencies in the kqueue API on OS X.
Unfortunately, 5da380a has a bug that effectively makes the select() thread
busy-loop. Revert this commit for now.
Currently, `uv_spawn` will set `environ` to the value of `options.env`, even if
`options.env` is `NULL`. This results in child processes for whom `environ ==
NULL`, which can cause a variety of unexpected issues.
Relocate the include of TargetConditionals.h and fixe the use of
TARGET_OS_IPHONE. Furthermore, uv__fsevents_init() and uv__fsevents_close are
now empty functions for iOS, since the FSEvents API is not available there.
Reopen the file descriptor when it refers to a tty. This lets us put the tty in
non-blocking mode without affecting other processes that share it with us.
Fixes#601.
This reverts commit 209abbab27.
Fixes the following SIGSEGV:
(gdb) f 1
#1 0x00007fc084683aec in uv__async_io (loop=0x7fc0848e0b40,
handle=0x7fc0848e0c78, events=1) at src/unix/async.c:175
175 ASYNC_CB(h)
(gdb) list
170
171 /* If we need to sweep all handles anyway - skip this loop */
172 if (!loop->async_sweep_needed) {
173 for (i = 0; i < end; i += sizeof(h)) {
174 h = *((uv_async_t**) (buf + i));
175 ASYNC_CB(h)
176 }
177 }
178
179 bytes -= end;
(gdb) print *h
$1 = {close_cb = 0x184e1b0, data = 0x18d9520, loop = 0x7fc0848e0b40,
type = 49, handle_queue = {prev = 0x18dae10, next = 0x7860c0}, flags = 32,
next_closing = 0x1863b40, pending = 0, async_cb = 0x31,
queue = {prev = 0x18dae50, next = 0x7860c0}}
(gdb)
It looks like the async handle gets closed or otherwise becomes invalid before
the sweep is executed.
Fixes#603.
Makes the new process name visible in both `ps` and `ps a`, with the caveat
that `ps` will only print the first 16 characters.
Before this commit, `ps` kept reporting the old process name.
Obtain the CPU frequency from /proc/cpuinfo because there may not be any
cpufreq info available in /sys. This also means that the reported CPU speed
from now on is the *maximum* speed, not the *actual* speed the CPU runs at.
This change only applies to x86 because ARM and MIPS don't report that
information in /proc/cpuinfo.
Fixes#588.
Include missing <string.h> header. Fixes the following compiler warning:
src/unix/async.c:182:7: warning: implicit declaration of
function ‘memmove’ [-Wimplicit-function-declaration]
Fixes the following gcc 4.7+ warning:
../src/unix/internal.h:105:13: warning: always_inline function might not be
inlinable [-Wattributes]
gcc wants the always_inline function to be annotated with the 'inline' keyword
which we can't do because we compile in C89 mode.
Using __inline is not an option because that makes clang generate warnings when
-Wlanguage-extension-token is enabled.
Therefore, remove the always_inline attribute altogether and hope that the
compiler is smart enough to inline the functions.
Simultaneously writing from multiple threads to the same file descriptor is not
safe on OS X. We already serialized all pwrite() system calls, apply the same
workaround to the write() system call.
Fixes a node.js test, test/simple/test-fs-sir-writes-alot.js, that was failing
because parts of the output file got filled with nul bytes.
Fixes a segmentation fault on 32 bits linux with glibc 2.15.
Thanks to Johan Bergström (@jbergstroem) for reporting the issue and testing
out the patch.
The only platforms where the dirent argument is non-const are OS X, OpenBSD
and older versions of FreeBSD (but not FreeBSD 9). Accommodate the first two.
Without this patch, the fallback implementation would be used if
uv_rwlock_init were to be called before a loop was created or
uv_default_loop() was called.
This commit fixes the following valgrind warning:
==26443== Conditional jump or move depends on uninitialised value(s)
==26443== at 0x44AAFF: uv__read (stream.c:872)
==26443== by 0x44ADD4: uv__stream_io (stream.c:1051)
==26443== by 0x4377B8: uv__io_rw (core.c:539)
==26443== by 0x43C761: ev_invoke_pending (ev.c:2145)
==26443== by 0x43724D: uv__poll (core.c:260)
==26443== by 0x437297: uv__run (core.c:269)
==26443== by 0x4372F6: uv_run (core.c:277)
==26443== by 0x42094B: run_test_pipe_ref4 (test-ref.c:334)
==26443== by 0x406551: run_test_part (runner.c:302)
==26443== by 0x405384: main (run-tests.c:57)
Don't return req->result after posting the work request. It's possible (if
unlikely) for a worker thread to process the request before the main thread
reaches the return statement.
Some platforms don't support sendfile() (netbsd, openbsd), others don't support
arbitrary file descriptors (freebsd, darwin) and yet others have quirks in their
implementation (sunos).
Work around the quirks. If all else fails, fall back to sendfile() emulation.
uv_fs_stat and uv_fs_lstat removed the trailing backslash (if any) from the path
in order to please a test case that was written for Windows. Remove the
compatibility hack and fix the test.
Free the memory that is used to store the new argv and envp. It's not strictly
necessary (the OS is going to reclaim the memory anyway) but it makes the output
from valgrind a lot less noisy.