view release on metacpan or search on metacpan
libuv/docs/code/plugin/plugin.h
libuv/docs/code/proc-streams/main.c
libuv/docs/code/proc-streams/test.c
libuv/docs/code/progress/main.c
libuv/docs/code/queue-cancel/main.c
libuv/docs/code/queue-work/main.c
libuv/docs/code/ref-timer/main.c
libuv/docs/code/signal/main.c
libuv/docs/code/spawn/main.c
libuv/docs/code/tcp-echo-server/main.c
libuv/docs/code/thread-create/main.c
libuv/docs/code/tty-gravity/main.c
libuv/docs/code/tty/main.c
libuv/docs/code/udp-dhcp/main.c
libuv/docs/code/uvcat/main.c
libuv/docs/code/uvstop/main.c
libuv/docs/code/uvtee/main.c
libuv/docs/code/uvwget/main.c
libuv/docs/make.bat
libuv/docs/src/api.rst
libuv/docs/src/async.rst
libuv/docs/src/fs_event.rst
libuv/docs/src/fs_poll.rst
libuv/docs/src/guide.rst
libuv/docs/src/guide/about.rst
libuv/docs/src/guide/basics.rst
libuv/docs/src/guide/eventloops.rst
libuv/docs/src/guide/filesystem.rst
libuv/docs/src/guide/introduction.rst
libuv/docs/src/guide/networking.rst
libuv/docs/src/guide/processes.rst
libuv/docs/src/guide/threads.rst
libuv/docs/src/guide/utilities.rst
libuv/docs/src/handle.rst
libuv/docs/src/idle.rst
libuv/docs/src/index.rst
libuv/docs/src/loop.rst
libuv/docs/src/migration_010_100.rst
libuv/docs/src/misc.rst
libuv/docs/src/pipe.rst
libuv/docs/src/poll.rst
libuv/docs/src/prepare.rst
libuv/docs/src/static/diagrams.key/Metadata/DocumentIdentifier
libuv/docs/src/static/diagrams.key/Metadata/Properties.plist
libuv/docs/src/static/diagrams.key/preview-micro.jpg
libuv/docs/src/static/diagrams.key/preview-web.jpg
libuv/docs/src/static/diagrams.key/preview.jpg
libuv/docs/src/static/favicon.ico
libuv/docs/src/static/logo.png
libuv/docs/src/static/loop_iteration.png
libuv/docs/src/stream.rst
libuv/docs/src/tcp.rst
libuv/docs/src/threading.rst
libuv/docs/src/threadpool.rst
libuv/docs/src/timer.rst
libuv/docs/src/tty.rst
libuv/docs/src/udp.rst
libuv/docs/src/upgrading.rst
libuv/docs/src/version.rst
libuv/gyp_uv.py
libuv/img/banner.png
libuv/img/logos.svg
libuv/include/uv.h
libuv/include/uv/aix.h
libuv/include/uv/android-ifaddrs.h
libuv/include/uv/bsd.h
libuv/include/uv/darwin.h
libuv/include/uv/errno.h
libuv/include/uv/linux.h
libuv/include/uv/os390.h
libuv/include/uv/posix.h
libuv/include/uv/stdint-msvc2008.h
libuv/include/uv/sunos.h
libuv/include/uv/threadpool.h
libuv/include/uv/tree.h
libuv/include/uv/unix.h
libuv/include/uv/version.h
libuv/include/uv/win.h
libuv/libuv.pc.in
libuv/LICENSE
libuv/LICENSE-docs
libuv/m4/as_case.m4
libuv/m4/libuv-check-flags.m4
libuv/MAINTAINERS.md
libuv/samples/socks5-proxy/server.c
libuv/samples/socks5-proxy/util.c
libuv/src/fs-poll.c
libuv/src/heap-inl.h
libuv/src/idna.c
libuv/src/idna.h
libuv/src/inet.c
libuv/src/queue.h
libuv/src/strscpy.c
libuv/src/strscpy.h
libuv/src/threadpool.c
libuv/src/timer.c
libuv/src/unix/aix-common.c
libuv/src/unix/aix.c
libuv/src/unix/android-ifaddrs.c
libuv/src/unix/async.c
libuv/src/unix/atomic-ops.h
libuv/src/unix/bsd-ifaddrs.c
libuv/src/unix/bsd-proctitle.c
libuv/src/unix/core.c
libuv/src/unix/cygwin.c
libuv/src/unix/os390-syscalls.c
libuv/src/unix/os390-syscalls.h
libuv/src/unix/os390.c
libuv/src/unix/pipe.c
libuv/src/unix/poll.c
libuv/src/unix/posix-hrtime.c
libuv/src/unix/posix-poll.c
libuv/src/unix/process.c
libuv/src/unix/procfs-exepath.c
libuv/src/unix/proctitle.c
libuv/src/unix/pthread-fixes.c
libuv/src/unix/signal.c
libuv/src/unix/spinlock.h
libuv/src/unix/stream.c
libuv/src/unix/sunos.c
libuv/src/unix/sysinfo-loadavg.c
libuv/src/unix/sysinfo-memory.c
libuv/src/unix/tcp.c
libuv/src/unix/thread.c
libuv/src/unix/tty.c
libuv/src/unix/udp.c
libuv/src/uv-common.c
libuv/src/uv-common.h
libuv/src/uv-data-getter-setters.c
libuv/src/version.c
libuv/src/win/async.c
libuv/src/win/atomicops-inl.h
libuv/src/win/core.c
libuv/src/win/detect-wakeup.c
libuv/src/win/pipe.c
libuv/src/win/poll.c
libuv/src/win/process-stdio.c
libuv/src/win/process.c
libuv/src/win/req-inl.h
libuv/src/win/signal.c
libuv/src/win/snprintf.c
libuv/src/win/stream-inl.h
libuv/src/win/stream.c
libuv/src/win/tcp.c
libuv/src/win/thread.c
libuv/src/win/tty.c
libuv/src/win/udp.c
libuv/src/win/util.c
libuv/src/win/winapi.c
libuv/src/win/winapi.h
libuv/src/win/winsock.c
libuv/src/win/winsock.h
libuv/SUPPORTED_PLATFORMS.md
libuv/test/benchmark-async-pummel.c
libuv/test/benchmark-async.c
libuv/test/benchmark-loop-count.c
libuv/test/benchmark-million-async.c
libuv/test/benchmark-million-timers.c
libuv/test/benchmark-multi-accept.c
libuv/test/benchmark-ping-pongs.c
libuv/test/benchmark-pound.c
libuv/test/benchmark-pump.c
libuv/test/benchmark-sizes.c
libuv/test/benchmark-spawn.c
libuv/test/benchmark-tcp-write-batch.c
libuv/test/benchmark-thread.c
libuv/test/benchmark-udp-pummel.c
libuv/test/blackhole-server.c
libuv/test/dns-server.c
libuv/test/echo-server.c
libuv/test/fixtures/empty_file
libuv/test/fixtures/load_error.node
libuv/test/run-benchmarks.c
libuv/test/run-tests.c
libuv/test/runner-unix.c
libuv/test/runner-unix.h
libuv/test/test-pipe-server-close.c
libuv/test/test-pipe-set-fchmod.c
libuv/test/test-pipe-set-non-blocking.c
libuv/test/test-platform-output.c
libuv/test/test-poll-close-doesnt-corrupt-stack.c
libuv/test/test-poll-close.c
libuv/test/test-poll-closesocket.c
libuv/test/test-poll-oob.c
libuv/test/test-poll.c
libuv/test/test-process-priority.c
libuv/test/test-process-title-threadsafe.c
libuv/test/test-process-title.c
libuv/test/test-queue-foreach-delete.c
libuv/test/test-ref.c
libuv/test/test-run-nowait.c
libuv/test/test-run-once.c
libuv/test/test-semaphore.c
libuv/test/test-shutdown-close.c
libuv/test/test-shutdown-eof.c
libuv/test/test-shutdown-twice.c
libuv/test/test-signal-multiple-loops.c
libuv/test/test-tcp-open.c
libuv/test/test-tcp-read-stop.c
libuv/test/test-tcp-shutdown-after-write.c
libuv/test/test-tcp-try-write.c
libuv/test/test-tcp-unexpected-read.c
libuv/test/test-tcp-write-after-connect.c
libuv/test/test-tcp-write-fail.c
libuv/test/test-tcp-write-queue-order.c
libuv/test/test-tcp-write-to-half-open-connection.c
libuv/test/test-tcp-writealot.c
libuv/test/test-thread-equal.c
libuv/test/test-thread.c
libuv/test/test-threadpool-cancel.c
libuv/test/test-threadpool.c
libuv/test/test-timer-again.c
libuv/test/test-timer-from-check.c
libuv/test/test-timer.c
libuv/test/test-tmpdir.c
libuv/test/test-tty-duplicate-key.c
libuv/test/test-tty.c
libuv/test/test-udp-alloc-cb-fail.c
libuv/test/test-udp-bind.c
libuv/test/test-udp-connect.c
libuv/test/test-udp-create-socket-early.c
Makefile.PL view on Meta::CPAN
use Alien::cmake3;
use Env qw/@PATH/;
my $bdir = "libuv/build";
unshift @PATH, Alien::cmake3->bin_dir;
mkdir($bdir) unless -d $bdir;
my $result = system(qq{cd $bdir && cmake .. -G "Unix Makefiles" -DCMAKE_C_FLAGS="-fPIC -O2"});
die "could not make Makefile\n" if $result != 0;
my $libs = '-lpthread';
$libs .= ' -liphlpapi -lpsapi -luserenv' if $^O eq 'MSWin32';
my %params = (
NAME => 'Alien::uv',
LIBS => $libs,
BIN_SHARE => {INCLUDE => {'libuv/include' => '/'}},
CLIB => {
DIR => $bdir,
FILE => 'libuv_a.a',
BUILD_CMD => '$(MAKE) uv_a',
libuv/CMakeLists.txt view on Meta::CPAN
list(APPEND uv_cflags -fvisibility=hidden --std=gnu89)
list(APPEND uv_cflags -Wall -Wextra -Wstrict-prototypes)
list(APPEND uv_cflags -Wno-unused-parameter)
endif()
set(uv_sources
src/fs-poll.c
src/idna.c
src/inet.c
src/strscpy.c
src/threadpool.c
src/timer.c
src/uv-common.c
src/uv-data-getter-setters.c
src/version.c)
set(uv_test_sources
test/blackhole-server.c
test/echo-server.c
test/run-tests.c
test/runner.c
libuv/CMakeLists.txt view on Meta::CPAN
test/test-pipe-server-close.c
test/test-pipe-set-fchmod.c
test/test-pipe-set-non-blocking.c
test/test-platform-output.c
test/test-poll-close-doesnt-corrupt-stack.c
test/test-poll-close.c
test/test-poll-closesocket.c
test/test-poll-oob.c
test/test-poll.c
test/test-process-priority.c
test/test-process-title-threadsafe.c
test/test-process-title.c
test/test-queue-foreach-delete.c
test/test-ref.c
test/test-run-nowait.c
test/test-run-once.c
test/test-semaphore.c
test/test-shutdown-close.c
test/test-shutdown-eof.c
test/test-shutdown-twice.c
test/test-signal-multiple-loops.c
libuv/CMakeLists.txt view on Meta::CPAN
test/test-tcp-open.c
test/test-tcp-read-stop.c
test/test-tcp-shutdown-after-write.c
test/test-tcp-try-write.c
test/test-tcp-unexpected-read.c
test/test-tcp-write-after-connect.c
test/test-tcp-write-fail.c
test/test-tcp-write-queue-order.c
test/test-tcp-write-to-half-open-connection.c
test/test-tcp-writealot.c
test/test-thread-equal.c
test/test-thread.c
test/test-threadpool-cancel.c
test/test-threadpool.c
test/test-timer-again.c
test/test-timer-from-check.c
test/test-timer.c
test/test-tmpdir.c
test/test-tty-duplicate-key.c
test/test-tty.c
test/test-udp-alloc-cb-fail.c
test/test-udp-bind.c
test/test-udp-connect.c
test/test-udp-create-socket-early.c
libuv/CMakeLists.txt view on Meta::CPAN
src/win/detect-wakeup.c
src/win/dl.c
src/win/error.c
src/win/fs.c
src/win/fs-event.c
src/win/getaddrinfo.c
src/win/getnameinfo.c
src/win/handle.c
src/win/loop-watcher.c
src/win/pipe.c
src/win/thread.c
src/win/poll.c
src/win/process.c
src/win/process-stdio.c
src/win/signal.c
src/win/snprintf.c
src/win/stream.c
src/win/tcp.c
src/win/tty.c
src/win/udp.c
src/win/util.c
src/win/winapi.c
src/win/winsock.c)
list(APPEND uv_test_libraries ws2_32)
list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c)
else()
list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
# Android has pthread as part of its c library, not as a separate
# libpthread.so.
list(APPEND uv_libraries pthread)
endif()
list(APPEND uv_sources
src/unix/async.c
src/unix/core.c
src/unix/dl.c
src/unix/fs.c
src/unix/getaddrinfo.c
src/unix/getnameinfo.c
src/unix/loop-watcher.c
src/unix/loop.c
src/unix/pipe.c
src/unix/poll.c
src/unix/process.c
src/unix/signal.c
src/unix/stream.c
src/unix/tcp.c
src/unix/thread.c
src/unix/tty.c
src/unix/udp.c)
list(APPEND uv_test_sources test/runner-unix.c)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
list(APPEND uv_defines
_ALL_SOURCE
_LINUX_SOURCE_COMPAT
_THREAD_SAFE
libuv/CMakeLists.txt view on Meta::CPAN
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
list(APPEND uv_libs dl)
list(APPEND uv_sources
src/unix/android-ifaddrs.c
src/unix/linux-core.c
src/unix/linux-inotify.c
src/unix/linux-syscalls.c
src/unix/procfs-exepath.c
src/unix/pthread-fixes.c
src/unix/sysinfo-loadavg.c
src/unix/sysinfo-memory.c)
endif()
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS/390")
list(APPEND uv_sources src/unix/proctitle.c)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
list(APPEND uv_sources src/unix/freebsd.c)
libuv/CMakeLists.txt view on Meta::CPAN
list(APPEND uv_defines _LARGE_TIME_API)
list(APPEND uv_defines _OPEN_MSGQ_EXT)
list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
list(APPEND uv_defines _OPEN_SYS_IF_EXT)
list(APPEND uv_defines _OPEN_SYS_SOCK_IPV6)
list(APPEND uv_defines _UNIX03_SOURCE)
list(APPEND uv_defines _UNIX03_THREADS)
list(APPEND uv_defines _UNIX03_WITHDRAWN)
list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED)
list(APPEND uv_sources
src/unix/pthread-fixes.c
src/unix/pthread-barrier.c
src/unix/os390.c
src/unix/os390-syscalls.c)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
list(APPEND uv_defines __EXTENSIONS__ _XOPEN_SOURCE=500)
list(APPEND uv_libraries kstat nsl sendfile socket)
list(APPEND uv_sources src/unix/no-proctitle.c src/unix/sunos.c)
endif()
libuv/ChangeLog view on Meta::CPAN
* build: make cmake install LICENSE only once (Thomas Karl Pietrowski)
* bsd: plug uv_fs_event_start() error path fd leak (Ben Noordhuis)
* unix: fix __FreeBSD_kernel__ typo (cjihrig)
* doc: add note about uv_run() not being reentrant (Ben Noordhuis)
* unix, win: make fs-poll close wait for resource cleanup (Anna Henningsen)
* doc: fix typo in uv_thread_options_t definition (Ryan Liptak)
* win: skip winsock initialization in safe mode (evgley)
* unix: refactor getsockname/getpeername methods (Santiago Gimeno)
* win,udp: allow to use uv_udp_open on bound sockets (Santiago Gimeno)
* udp: add support for UDP connected sockets (Santiago Gimeno)
* build: fix uv_test shared uv Windows cmake build (ptlomholt)
libuv/ChangeLog view on Meta::CPAN
* unix: fix epoll cpu 100% issue (yeyuanfeng)
* openbsd,tcp: special handling of EINVAL on connect (ptlomholt)
* win: simplify registry closing in uv_cpu_info() (cjihrig)
* src,include: define UV_MAXHOSTNAMESIZE (cjihrig)
* win: return product name in uv_os_uname() version (cjihrig)
* thread: allow specifying stack size for new thread (Anna Henningsen)
* win: fix duplicate tty vt100 fn key (erw7)
* unix: don't attempt to invalidate invalid fd (Ben Noordhuis)
2019.01.19, Version 1.25.0 (Stable), 4a10a9d425863330af199e4b74bd688e62d945f1
Changes since version 1.24.1:
libuv/ChangeLog view on Meta::CPAN
* unix: refactor uv__write() (Ben Noordhuis)
* unix: don't send handle twice on partial write (Ben Noordhuis)
* tty,win: fix Alt+key under WSL (Bartosz Sosnowski)
* build: support running tests in out-of-tree builds (Jameson Nash)
* fsevents: really watch files with fsevents on macos 10.7+ (Jameson Nash)
* thread,mingw64: need intrin.h header for SSE2 MemoryBarrier (Jameson Nash)
* win: fix sizeof-pointer-div warning (cjihrig)
* unix,win: add uv_os_uname() (cjihrig)
* win, tty: fix CreateFileW() return value check (Bartosz Sosnowski)
* unix: enable IPv6 tests on OpenBSD (ptlomholt)
* test: fix test-ipc spawn_helper exit_cb (Santiago Gimeno)
libuv/ChangeLog view on Meta::CPAN
* unix: harden string copying, introduce strscpy() (Ben Noordhuis)
* linux: get rid of strncpy() call (Ben Noordhuis)
* aix: get rid of strcat() calls (Ben Noordhuis)
* aix: fix data race in uv_fs_event_start() (Ben Noordhuis)
* win: fs: fix `FILE_FLAG_NO_BUFFERING` for writes (Joran Dirk Greef)
* build: don't link against -lpthread on Android (Michael Meier)
2018.11.14, Version 1.24.0 (Stable), 2d427ee0083d1baf995df4ebf79a3f8890e9a3e1
Changes since version 1.23.2:
* unix: do not require PATH_MAX to be defined (Brad King)
* win,doc: path encoding in uv_fs_XX is UTF-8 (hitesh)
libuv/ChangeLog view on Meta::CPAN
* Revert "Revert "unix,fs: fix for potential partial reads/writes"" (Jameson
Nash)
* unix,readv: always permit partial reads to return (Jameson Nash)
* win,tty: fix uv_tty_close() (Bartosz Sosnowski)
* doc: remove extraneous "on" (Ben Noordhuis)
* unix,win: fix threadpool race condition (Anna Henningsen)
* unix: rework thread barrier implementation (Ben Noordhuis)
* aix: switch to libuv's own thread barrier impl (Ben Noordhuis)
* unix: signal done to last thread barrier waiter (Ben Noordhuis)
* test: add uv_barrier_wait serial thread test (Ali Ijaz Sheikh)
* unix: optimize uv_fs_readlink() memory allocation (Ben Noordhuis)
* win: remove req.c and other cleanup (Carlo Marcelo Arenas Belón)
* aix: don't EISDIR on read from directory fd (Ben Noordhuis)
2018.09.22, Version 1.23.1 (Stable), d2282b3d67821dc53c907c2155fa8c5c6ce25180
Changes since version 1.23.0:
* unix,win: limit concurrent DNS calls to nthreads/2 (Anna Henningsen)
* doc: add addaleax to maintainers (Anna Henningsen)
* doc: add missing slash in stream.rst (Emil Bay)
* unix,fs: use utimes & friends for uv_fs_utime (Jeremiah Senkpiel)
* unix,fs: remove linux fallback from utimesat() (Jeremiah Senkpiel)
* unix,fs: remove uv__utimesat() syscall fallback (Jeremiah Senkpiel)
libuv/ChangeLog view on Meta::CPAN
2018.07.11, Version 1.22.0 (Stable), 8568f78a777d79d35eb7d6994617267b9fb33967
Changes since version 1.21.0:
* unix: remove checksparse.sh (Ben Noordhuis)
* win: fix mingw build error (Ben Noordhuis)
* win: fix -Wunused-function warnings in thread.c (Ben Noordhuis)
* unix,win: merge timers implementation (Ben Noordhuis)
* win: fix pointer type in pipe.c (Ben Noordhuis)
* win: fixing build for older MSVC compilers (Michael Fero)
* zos: clear poll events on every iteration (jBarz)
* zos: write-protect message queue (jBarz)
libuv/ChangeLog view on Meta::CPAN
* test: add test for IPC deadlock on Windows (
* win,pipe: fix IPC pipe deadlock (Bert Belder)
* unix: catch some cases of watching fd twice (Ben Noordhuis)
* test: use custom timeout for getaddrinfo_fail_sync (Ben Noordhuis)
* Revert "win: add Windows XP support to uv_if_indextoname()" (Bert Belder)
* win,thread: remove fallback uv_cond implementation (Bert Belder)
* src,test: s/olny/only (cjihrig)
* unix: close signal pipe fds on unload (Ben Noordhuis)
* win: allow setting udp socket options before bind (cjihrig)
* unix: return UV_ENOTSUP on FICLONE_FORCE failure (cjihrig)
* win,pipe: remove unreferenced local variable (Bert Belder)
* win,code: remove GetQueuedCompletionStatus-based poller (Bert Belder)
* win: remove the remaining dynamic kernel32 imports (Bert Belder)
* test: speedup process-title-threadsafe on macOS (cjihrig)
* core: move all include files except uv.h to uv/ (Saúl Ibarra Corretgé)
* win: move stdint-msvc2008.h to include/uv/ (Ben Noordhuis)
* build: fix cygwin install (Ben Noordhuis)
* build,win: remove MinGW Makefile (Saúl Ibarra Corretgé)
* build: add a cmake build file (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
2018.01.18, Version 1.19.0 (Stable), effbb7c9d29090b2e085a40867f8cdfa916a66df
Changes since version 1.18.0:
* core: add getter/setter functions for easier ABI compat (Anna Henningsen)
* unix: make get(set)_process_title MT-safe (Matt Harrison)
* unix,win: wait for threads to start (Ben Noordhuis)
* test: add threadpool init/teardown test (Bartosz Sosnowski)
* win, process: uv_kill improvements (Bartosz Sosnowski)
* win: set _WIN32_WINNT to 0x0600 (cjihrig)
* zos: implement uv_fs_event* functions (jBarz)
* unix,tcp: avoid marking server sockets connected (Jameson Nash)
* doc: mark Windows 7 as Tier 1 support (Bartosz Sosnowski)
* win: map 0.0.0.0 and :: addresses to localhost (Bartosz Sosnowski)
* build: install libuv.pc unconditionally (Ben Noordhuis)
* test: remove custom timeout for thread test on ppc (Ben Noordhuis)
* test: allow multicast not permitted status (Jérémy Lal)
* test: allow net unreachable status in udp test (Ben Noordhuis)
* unix: use SA_RESTART when setting our sighandler (Brad King)
* unix,fs: fix for potential partial reads/writes (Ben Wijen)
* win,build: do not build executable installer for dll (Bert Belder)
libuv/ChangeLog view on Meta::CPAN
2017.12.02, Version 1.18.0 (Stable), 1489c98b7fc17f1702821a269eb0c5e730c5c813
Changes since version 1.17.0:
* aix: fix -Wmaybe-uninitialized warning (cjihrig)
* doc: remove note about SIGWINCH on Windows (Bartosz Sosnowski)
* Revert "unix,win: wait for threads to start" (Ben Noordhuis)
* unix,win: add uv_os_getpid() (Bartosz Sosnowski)
* unix: remove incorrect assertion in uv_shutdown() (Jameson Nash)
* doc: fix IRC URL in CONTRIBUTING.md (Matt Harrison)
2017.11.25, Version 1.17.0 (Stable), 1344d2bb82e195d0eafc0b40ba103f18dfd04cc5
libuv/ChangeLog view on Meta::CPAN
* win: fix build on case-sensitive file systems (Ben Noordhuis)
* win: fix test runner build with mingw64 (Ben Noordhuis)
* win: remove unused variable in test/test-fs.c (Ben Noordhuis)
* zos: add strnlen() implementation (jBarz)
* unix: keep track of bound sockets sent via spawn (jBarz)
* unix,win: wait for threads to start (Ben Noordhuis)
* test: add threadpool init/teardown test (Bartosz Sosnowski)
* test: avoid malloc() in threadpool test (Ben Noordhuis)
* test: lower number of tasks in threadpool test (Ben Noordhuis)
* win: issue memory barrier in uv_thread_join() (Ben Noordhuis)
* ibmi: add support for new platform (Xu Meng)
* test: fix test-spawn compilation (Bartosz Sosnowski)
2017.11.11, Version 1.16.1 (Stable), 4056fbe46493ef87237e307e0025e551db875e13
Changes since version 1.16.0:
libuv/ChangeLog view on Meta::CPAN
* test: fix -Wstrict-prototypes warnings (Ben Noordhuis)
* unix, windows: map ENOTTY errno (Ben Noordhuis)
* unix: fall back to fsync() if F_FULLFSYNC fails (Joran Dirk Greef)
* unix: do not close invalid kqueue fd after fork (jBarz)
* zos: reset epoll data after fork (jBarz)
* zos: skip fork_threadpool_queue_work_simple (jBarz)
* test: keep platform_output as first test (Bartosz Sosnowski)
* win: fix non-English dlopen error message (Bartosz Sosnowski)
* unix,win: add uv_os_getppid() (cjihrig)
* test: fix const qualification compiler warning (Ben Noordhuis)
* doc: mark uv_default_loop() as not thread safe (rayrase)
* win, pipe: null-initialize stream->shutdown_req (Jameson Nash)
* tty, win: get SetWinEventHook pointer at startup (Bartosz Sosnowski)
* test: no extra new line in skipped test output (Bartosz Sosnowski)
* pipe: allow access from other users (Bartosz Sosnowski)
* unix,win: add uv_if_{indextoname,indextoiid} (Pekka Nikander)
libuv/ChangeLog view on Meta::CPAN
* unix: support copying empty files (cjihrig)
* unix: truncate destination in uv_fs_copyfile() (Nick Logan)
* win,build: keep cwd when setting build environment (darobs)
* test: add NetBSD support to test-udp-ipv6.c (Kamil Rytarowski)
* unix: add NetBSD support in core.c (Kamil Rytarowski)
* linux: increase thread stack size with musl libc (Ben Noordhuis)
* netbsd: correct uv_exepath() on NetBSD (Kamil Rytarowski)
* test: clean up semaphore after use (jBarz)
* win,build: bump vswhere_usability_wrapper to 2.0.0 (Refael Ackermann)
* win: let UV_PROCESS_WINDOWS_HIDE hide consoles (cjihrig)
* zos: lock protect global epoll list in epoll_ctl (jBarz)
libuv/ChangeLog view on Meta::CPAN
* win, test: remove surplus CloseHandle (Bartosz Sosnowski)
2017.08.17, Version 1.14.0 (Stable), e0d31e9e21870f88277746b6d59cf07b977cdfea
Changes since version 1.13.1:
* unix: check for NULL in uv_os_unsetenv for parameter name (André Klitzing)
* doc: add thread safety warning for process title (Matthew Taylor)
* unix: always copy process title into local buffer (Matthew Taylor)
* poll: add support for OOB TCP and GPIO interrupts (CurlyMoo)
* win,build: fix appveyor properly (Refael Ackermann)
* win: include filename in dlopen error message (Ben Noordhuis)
* aix: add netmask, mac address into net interfaces (Gireesh Punathil)
libuv/ChangeLog view on Meta::CPAN
* unix, windows: map EREMOTEIO errno (Ben Noordhuis)
* unix: fix wrong MAC of uv_interface_address (XadillaX)
* win,build: fix building from Windows SDK or VS console (Saúl Ibarra Corretgé)
* github: fix link to help repo in issue template (Ben Noordhuis)
* zos: remove nonexistent include from autotools build (Saúl Ibarra Corretgé)
* misc: remove reference to pthread-fixes.h from LICENSE (Saúl Ibarra Corretgé)
* docs: fix guide source code example paths (Anticrisis)
* android: fix compilation with new NDK versions (Saúl Ibarra Corretgé)
* misc: add android-toolchain to .gitignore (Saúl Ibarra Corretgé)
* win, fs: support unusual reparse points (Bartosz Sosnowski)
* android: fix detection of pthread_condattr_setclock (Saúl Ibarra Corretgé)
* android: remove no longer needed check (Saúl Ibarra Corretgé)
* doc: update instructions for building on Android (Saúl Ibarra Corretgé)
* win, process: support semicolons in PATH variable (Bartosz Sosnowski)
* doc: document uv_async_(init|send) return values (Ben Noordhuis)
* doc: add Android as a tier 3 supported platform (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* build: add a comma to uv.gyp (Gemini Wen)
* win: restore file pos after positional read/write (Bartosz Sosnowski)
* unix,stream: return error on closed handle passing (Santiago Gimeno)
* unix,benchmark: use fd instead of FILE* after fork (jBarz)
* zos: avoid compiler warnings (jBarz)
* win,pipe: race condition canceling readfile thread (Jameson Nash)
* sunos: filter out non-IPv4/IPv6 interfaces (Sebastian Wiedenroth)
* sunos: fix cmpxchgi and cmpxchgl type error (Sai Ke WANG)
* unix: reset signal disposition before execve() (Ben Noordhuis)
* unix: reset signal mask before execve() (Ben Noordhuis)
* unix: fix POLLIN assertion on server read (jBarz)
libuv/ChangeLog view on Meta::CPAN
* zos: add support for new platform (John Barboza)
* test: make tcp_close_while_connecting more resilient (Saúl Ibarra Corretgé)
* build: use '${prefix}' for pkg-config 'exec_prefix' (Matt Clarkson)
* build: GNU/kFreeBSD support (Jeffrey Clark)
* zos: use PLO instruction for atomic operations (John Barboza)
* zos: use pthread helper functions (John Barboza)
* zos: implement uv__fs_futime (John Barboza)
* unix: expand range of values for usleep (John Barboza)
* zos: track unbound handles and bind before listen (John Barboza)
* test: improve tap output on test failures (Santiago Gimeno)
* test: refactor fs_event_close_in_callback (Julien Gilli)
libuv/ChangeLog view on Meta::CPAN
* zos: implement uv__io_check_fd (John Barboza)
* unix: unneccessary use const qualifier in container_of (John Barboza)
* win,tty: add support for ANSI codes in win10 v1511 (Imran Iqbal)
* doc: add santigimeno to maintainers (Santiago Gimeno)
* win: fix typo in type name (Saúl Ibarra Corretgé)
* unix: always define pthread barrier fallback pad (Saúl Ibarra Corretgé)
* test: use RETURN_SKIP in spawn_setuid_setgid test (Santiago Gimeno)
* win: add disk read/write count to uv_getrusage (Imran Iqbal)
* doc: document uv_fs_realpath caveats (Saúl Ibarra Corretgé)
* test: improve spawn_setuid_setgid test (Santiago Gimeno)
* test: fix building pty test on Android (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* doc: add ABI tracker link to README (Saúl Ibarra Corretgé)
* win,tty: fix uv_tty_set_mode race conditions (Bartosz Sosnowski)
* test: fix fs_fstat on Android (Vit Gottwald)
* win, test: fix fs_event_watch_dir_recursive (Bartosz Sosnowski)
* doc: add description of uv_handle_type (Vit Gottwald)
* build: use -pthreads for tests with autotools (Julien Gilli)
* win: fix leaky fs request buffer (Jason Ginchereau)
* doc: note buffer lifetime requirements in uv_write (VladimÃr Äunát)
* doc: add reference to uv_update_time on uv_timer_start (Alex Hultman)
* win: fix winapi function pointer typedef syntax (Brad King)
* test: fix tcp_close_while_connecting CI failures (Ben Noordhuis)
* test: make threadpool_cancel_single deterministic (Ben Noordhuis)
* test: make threadpool saturation reliable (Ben Noordhuis)
* unix: don't malloc in uv_thread_create() (Ben Noordhuis)
* unix: don't include CoreServices globally on macOS (Brad King)
* unix,win: add uv_translate_sys_error() public API (Philippe Laferriere)
* win: remove unused static variables (Ben Noordhuis)
* win: silence -Wmaybe-uninitialized warning (Ben Noordhuis)
* signal: replace pthread_once with uv_once (Santiago Gimeno)
* test: fix sign-compare warning (Will Speak)
* common: fix unused variable warning (Brad King)
2016.05.17, Version 1.9.1 (Stable), d989902ac658b4323a4f4020446e6f4dc449e25c
Changes since version 1.9.0:
libuv/ChangeLog view on Meta::CPAN
* linux: don't abort on malformed /proc/stat (Ben Noordhuis)
* linux: fix long lines in linux-core.c (Ben Noordhuis)
* test: fix fs_event_watch_file_current_dir for AIX (Imran Iqbal)
* unix,fs: code cleanup of uv_fs_event_start for AIX (Imran Iqbal)
* unix: delay signal handling until after normal i/o (Ben Noordhuis)
* android: pthread_sigmask() does not set errno (Oguz Bastemur)
* win: work around sharepoint scandir bug (Ben Noordhuis)
* unix: guard against clobbering errno in uv__free() (Ben Noordhuis)
* unix: remove unneeded SAVE_ERRNO wrappers (Ben Noordhuis)
* test: skip fs_event_close_in_callback on AIX (Imran Iqbal)
* win: add maxrss, pagefaults to uv_getrusage() (Robert Jefe Lindstaedt)
libuv/ChangeLog view on Meta::CPAN
* build, mingw: set LIBS in configure.ac (Tony Theodore)
* win: improve uv__convert_utf16_to_utf8 (Saúl Ibarra Corretgé)
* win: simplified UTF16 -> UTF8 conversions (Saúl Ibarra Corretgé)
* win: remove unneeded condition (Saúl Ibarra Corretgé)
* darwin: work around condition variable kernel bug (Ben Noordhuis)
* darwin: make thread stack multiple of page size (Ben Noordhuis)
* build,win: rename platform to msbuild_platform (João Reis)
* gitignore: ignore VS temporary database files (João Reis)
* test: skip emfile on AIX (Imran Iqbal)
* unix: use system allocator for scandir() (cjihrig)
* common: release uv_fs_scandir() array (cjihrig)
libuv/ChangeLog view on Meta::CPAN
* win: wait for full timeout duration (João Reis)
* unix: fix support for uClibc-ng (Martin Bark)
* doc: indicate where new test files need to be added (Dave)
* test,unix: fix logic error in test runner (Ben Noordhuis)
* fs: don't nullify req->bufs on EINTR (Dave)
* osx: set the default thread stack size to RLIMIT_STACK (Saúl Ibarra Corretgé)
* build: invoke libtoolize with --copy (Ben Noordhuis)
* test: fixup eintr_handling (Saúl Ibarra Corretgé)
* osx: avoid compilation warning with Clang (Saúl Ibarra Corretgé)
* test,win: fix compilation with shared lib (Alexis Murzeau)
* test: fix race condition in pipe-close-stdout (Imran Iqbal)
* unix,win: add uv_os_tmpdir() (cjihrig)
* ios: fix undefined PTHREAD_STACK_MIN (Didiet)
* test: fix threadpool_multiple_event_loops for AIX (Imran Iqbal)
* unix: report errors for unpollable fds (Ben Noordhuis)
* win: fix watching root files (Nicholas Vavilov)
* build,win: print the Visual Studio version in use (Saúl Ibarra Corretgé)
* build,win: remove unneeded condition from GYP file (Saúl Ibarra Corretgé)
* test,win: fix compilation warning (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* build: python 2.x/3.x consistent print usage (Rasmus Christian Pedersen)
* test: assume no IPv6 if interfaces cannot be listed (Nan Xiang)
* darwin: replace F_FULLFSYNC with fdatasync syscall (Saúl Ibarra Corretgé)
* doc: add missing write callback to example (Nándor István Krácser)
* build: compile with -D_THREAD_SAFE on AIX (Imran Iqbal)
* test: fix threadpool_multiple_event_loops on PPC (Imran Iqbal)
* test: reduce timeout in tcp_close_while_connecting (Imran Iqbal)
* unix, win: consistently null-terminate buffers (Saúl Ibarra Corretgé)
* unix, win: count null byte on UV_ENOBUFS (Saúl Ibarra Corretgé)
* test: fix deadlocks in uv_cond_wait (Katsutoshi Horie)
* linux: fix cpu count (Lukasz Jagiello)
libuv/ChangeLog view on Meta::CPAN
* fs: add uv_fs_realpath() (Yuval Brik)
* win: fix path for removed and renamed fs events (Joran Dirk Greef)
* win: do not read more from stream than available (Jeremy Whitlock)
* test: test that uv_close() doesn't corrupt QUEUE (Andrey Mazo)
* unix: fix uv_fs_event_stop() from fs_event_cb (Andrey Mazo)
* test: fix self-deadlocks in thread_rwlock_trylock (Ben Noordhuis)
* src: remove non ascii character (sztomi)
* test: fix test udp_multicast_join6 for AIX (Imran Iqbal)
2015.09.23, Version 1.7.5 (Stable), a8c1136de2cabf25b143021488cbaab05834daa8
Changes since version 1.7.4:
libuv/ChangeLog view on Meta::CPAN
* win: fix unsavory rwlock fallback implementation (Bert Belder)
* doc: clarify repeat timer behavior (Eli Skeggs)
2015.08.28, Version 1.7.3 (Stable), 93877b11c8b86e0a6befcda83a54555c1e36e4f0
Changes since version 1.7.2:
* threadpool: fix thread starvation bug (Ben Noordhuis)
2015.08.25, Version 1.7.2 (Stable), 4d13a013fcfa72311f0102751fdc7951873f466c
Changes since version 1.7.1:
* unix, win: make uv_loop_init return on error (Willem Thiart)
* win: reset pipe handle for pipe servers (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* core: add UV_VERSION_HEX macro (Saúl Ibarra Corretgé)
* doc: add section with version-checking macros and functions (Saúl Ibarra
Corretgé)
* tty: cleanup handle if uv_tty_init fails (Saúl Ibarra Corretgé)
* darwin: save a fd when FSEvents is used (Saúl Ibarra Corretgé)
* win: fix returning thread id in uv_thread_self (Saúl Ibarra Corretgé)
* common: use offsetof for QUEUE_DATA (Saúl Ibarra Corretgé)
* win: remove UV_HANDLE_CONNECTED (A. Hauptmann)
* docs: add Windows specific note for uv_fs_open (Saúl Ibarra Corretgé)
* doc: add note about uv_fs_scandir (Saúl Ibarra Corretgé)
* test,unix: reduce stack size of watchdog threads (Ben Noordhuis)
* win: add support for recursive file watching (Saúl Ibarra Corretgé)
* win,tty: support consoles with non-default colors (John McNamee)
* doc: add missing variable name (Yosuke Furukawa)
* stream: squelch ECONNRESET error if already closed (Santiago Gimeno)
* build: remove ancient condition from common.gypi (Saúl Ibarra Corretgé)
* tests: skip some tests when network is unreachable (Luca Bruno)
* build: proper support for android cross compilation (guworks)
* android: add missing include to pthread-fixes.c (RossBencina)
* test: fix compilation warning (Saúl Ibarra Corretgé)
* doc: add a note about uv_dirent_t.type (Saúl Ibarra Corretgé)
* win,test: fix shared library build (Saúl Ibarra Corretgé)
* test: fix compilation warning (Santiago Gimeno)
* build: add experimental Windows installer (Roger A. Light)
* threadpool: send signal only when queue is empty (chenttuuvv)
* aix: fix uv_exepath with relative paths (Richard Lau)
* build: fix version syntax in AppVeyor file (Saúl Ibarra Corretgé)
* unix: allow nbufs > IOV_MAX in uv_fs_{read,write} (ronkorving)
2015.06.06, Version 1.6.1 (Stable), 30c8be07bb78a66fdee5141626bf53a49a17094a
libuv/ChangeLog view on Meta::CPAN
* aix: add ahafs autoconf detection and README notes (Andrew Paprocki)
* core: add ability to customize memory allocator (Saúl Ibarra Corretgé)
2015.05.07, Version 1.5.0 (Stable), 4e77f74c7b95b639b3397095db1bc5bcc016c203
Changes since version 1.4.2:
* doc: clarify that the thread pool primites are not thread safe (Andrius
Bentkus)
* aix: always deregister closing fds from epoll (Michael)
* unix: fix glibc-2.20+ macro incompatibility (Massimiliano Torromeo)
* doc: add Sphinx plugin for generating links to man pages (Saúl Ibarra
Corretgé)
* doc: link system and library calls to man pages (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* build: update the location of gyp (Stephen von Takach)
* win: name all anonymous structs and unions (TomCrypto)
* linux: work around epoll bug in kernels 3.10-3.19 (Ben Noordhuis)
* darwin: fix size calculation in select() fallback (Ole André Vadla Ravnås)
* solaris: fix setsockopt for multicast options (Julien Gilli)
* test: fix race condition in multithreaded test (Ben Noordhuis)
* doc: fix long lines in tty.rst (Ben Noordhuis)
* test: use UV_TTY_MODE_* values in tty test (Ben Noordhuis)
* unix: don't clobber errno in uv_tty_reset_mode() (Ben Noordhuis)
* unix: reject non-tty fds in uv_tty_init() (Ben Noordhuis)
* win: fix pipe blocking writes (Alexis Campailla)
libuv/ChangeLog view on Meta::CPAN
Changes since version 1.4.1:
* stream: ignore EINVAL for SO_OOBINLINE on OS X (Fedor Indutny)
2015.02.25, Version 1.4.1 (Stable), e8e3fc5789cc0f02937879d141cca0411274093c
Changes since version 1.4.0:
* win: don't use inline keyword in thread.c (Ben Noordhuis)
* windows: fix setting dirent types on uv_fs_scandir_next (Saúl Ibarra
Corretgé)
* unix,windows: make uv_thread_create() return errno (Ben Noordhuis)
* tty: fix build for SmartOS (Julien Gilli)
* unix: fix for uv_async data race (Michael Penick)
* unix, windows: map EHOSTDOWN errno (Ben Noordhuis)
* stream: use SO_OOBINLINE on OS X (Fedor Indutny)
2015.02.10, Version 1.4.0 (Stable), 19fb8a90648f3763240db004b77ab984264409be
Changes since version 1.3.0:
* unix: check Android support for pthread_cond_timedwait_monotonic_np (Leith
Bade)
* test: use modified path in test (cjihrig)
* unix: implement uv_stream_set_blocking() (Ben Noordhuis)
2015.01.29, Version 1.3.0 (Stable), 165685b2a9a42cf96501d79cd6d48a18aaa16e3b
Changes since version 1.2.1:
* unix, windows: set non-block mode in uv_poll_init (Saúl Ibarra Corretgé)
* doc: clarify which flags are supported in uv_fs_event_start (Saúl Ibarra
Corretgé)
* win,unix: move loop functions which have identical implementations (Andrius
Bentkus)
* doc: explain how the threadpool is allocated (Alex Mo)
* doc: clarify uv_default_loop (Saúl Ibarra Corretgé)
* unix: fix implicit declaration compiler warning (Ben Noordhuis)
* unix: fix long line introduced in commit 94e628fa (Ben Noordhuis)
* unix, win: add synchronous uv_get{addr,name}info (Saúl Ibarra Corretgé)
* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* linux: fix epoll_pwait() sigmask size calculation (Ben Noordhuis)
* tty: implement binary I/O terminal mode (Yuri D'Elia)
* test: fix spawn test with autotools build (Ben Noordhuis)
* test: skip ipv6 tests when ipv6 is not supported (Ben Noordhuis)
* common: move STATIC_ASSERT to uv-common.h (Alexey Melnichuk)
* win/thread: store thread handle in a TLS slot (Alexey Melnichuk)
* unix: fix ttl, multicast ttl and loop options on IPv6 (Saúl Ibarra Corretgé)
* linux: fix support for preadv/pwritev-less kernels (Ben Noordhuis)
* unix: make uv_exepath(size=0) return UV_EINVAL (Ben Noordhuis)
* darwin: fix uv_exepath(smallbuf) UV_EPERM error (Ben Noordhuis)
* openbsd: fix uv_exepath(smallbuf) UV_EINVAL error (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* gitignore: ignore Visual Studio files (Marc Schlaich)
* win: set fallback message if FormatMessage fails (Marc Schlaich)
* win: fall back to default language in uv_dlerror (Marc Schlaich)
* test: improve compatibility for dlerror test (Marc Schlaich)
* test: check dlerror is "no error" in no error case (Marc Schlaich)
* build: link against -pthread (Logan Rosen)
* win: scandir use 'ls' for formatting long strings (Kenneth Perry)
2014.12.10, Version 1.0.2 (Stable), eec671f0059953505f9a3c9aeb7f9f31466dd7cd
Changes since version 1.0.1:
* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
(huxingyi)
* doc: mention homebrew in README (Mikhail Mukovnikov)
* doc: add learnuv workshop to README (Thorsten Lorenz)
* doc: fix parameter name in uv_fs_access (Saúl Ibarra Corretgé)
* unix: use cfmakeraw() for setting raw TTY mode (Yuri D'Elia)
* win: fix uv_thread_self() (Alexis Campailla)
* build: add x32 support to gyp build (Ben Noordhuis)
* build: remove dtrace probes (Ben Noordhuis)
* doc: fix link in misc.rst (Manos Nikolaidis)
* mailmap: remove duplicated entries (Saúl Ibarra Corretgé)
* gyp: fix comment regarding version info location (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* doc: fix punctuation and grammar in README (Jeff Widman)
* windows: return libuv error codes in uv_poll_init() (cjihrig)
* unix, windows: add uv_fs_access() (cjihrig)
* windows: fix netmask detection (Alexis Campailla)
* unix, windows: don't include null byte in uv_cwd size (Saúl Ibarra Corretgé)
* unix, windows: add uv_thread_equal (Tomasz KoÅodziejski)
* windows: fix fs_write with nbufs > 1 and offset (Unknown W. Brackets)
2014.10.21, Version 0.10.29 (Stable), 2d728542d3790183417f8f122a110693cd85db14
Changes since version 0.10.28:
* darwin: allocate enough space for select() hack (Fedor Indutny)
libuv/ChangeLog view on Meta::CPAN
* include: avoid using C++ 'template' reserved word (Iñaki Baz Castillo)
* include: fix version number (Saúl Ibarra Corretgé)
2014.07.32, Version 0.11.27 (Unstable), ffe24f955032d060968ea0289af365006afed55e
Changes since version 0.11.26:
* unix, windows: use the same threadpool implementation (Saúl Ibarra Corretgé)
* unix: use struct sockaddr_storage for target UDP addr (Saúl Ibarra Corretgé)
* doc: add documentation to uv_udp_start_recv (Andrius Bentkus)
* common: use common uv__count_bufs code (Andrius Bentkus)
* unix, win: add send_queue_size and send_queue_count to uv_udp_t (Andrius
Bentkus)
libuv/ChangeLog view on Meta::CPAN
* unix: guarantee write queue cb execution order in streams (Andrius Bentkus)
* img: add logo files (Saúl Ibarra Corretgé)
* aix: improve AIX compatibility (Andrew Low)
* windows: return bind error immediately when implicitly binding (Saúl Ibarra
Corretgé)
* windows: don't use atexit for cleaning up the threadpool (Saúl Ibarra
Corretgé)
* windows: destroy work queue elements when colsing a loop (Saúl Ibarra
Corretgé)
* unix, windows: add uv_fs_mkdtemp (Pavel Platto)
* build: handle platforms without multiprocessing.synchronize (Saúl Ibarra
Corretgé)
libuv/ChangeLog view on Meta::CPAN
* unix, windows: getnameinfo implementation (Rasmus Pedersen)
* heap: fix `heap_remove()` (Fedor Indutny)
* unix, windows: fix parsing scoped IPv6 addresses (Saúl Ibarra Corretgé)
* windows: fix handling closed socket while poll handle is closing (Saúl Ibarra
Corretgé)
* thread: barrier functions (Ben Noordhuis)
* windows: fix PYTHON environment variable usage (Jay Satiro)
* unix, windows: return system error on EAI_SYSTEM (Saúl Ibarra Corretgé)
* windows: fix handling closed socket while poll handle is closing (Saúl Ibarra
Corretgé)
* unix: don't run i/o callbacks after prepare callbacks (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* windows: fall back for volume info query (Isaiah Norton)
* pipe: allow queueing pending handles (Fedor Indutny)
* windows: fix winsock status codes for address errors (Raul Martins)
* windows: Remove unused variable from uv__pipe_insert_pending_socket (David
Capello)
* unix: workaround broken pthread_sigmask on Android (Paul Tan)
* error: add ENXIO for O_NONBLOCK FIFO open() (Fedor Indutny)
* freebsd: use accept4, introduced in version 10 (Saúl Ibarra Corretgé)
* windows: fix warnings of MinGW -Wall -O3 (StarWing)
* openbsd, osx: fix compilation warning on scandir (Saúl Ibarra Corretgé)
* linux: always deregister closing fds from epoll (Geoffry Song)
libuv/ChangeLog view on Meta::CPAN
* unix: fix uv_fs_write when using an empty buffer (Saúl Ibarra Corretgé)
* unix, windows: add assertion in uv_loop_delete (Saúl Ibarra Corretgé)
2014.02.27, Version 0.11.20 (Unstable), 88355e081b51c69ee1e2b6b0015a4e3d38bd0579
Changes since version 0.11.19:
* stream: start thread after assignments (Oguz Bastemur)
* fs: `uv__cloexec()` opened fd (Fedor Indutny)
* gyp: qualify `library` variable (Fedor Indutny)
* unix, win: add uv_udp_set_multicast_interface() (Austin Foxley)
* unix: fix uv_tcp_nodelay return value in case of error (Saúl Ibarra Corretgé)
* unix: call setgoups before calling setuid/setgid (Saúl Ibarra Corretgé)
libuv/ChangeLog view on Meta::CPAN
* linux: always deregister closing fds from epoll (Geoffry Song)
* error: add ENXIO for O_NONBLOCK FIFO open() (Fedor Indutny)
2014.02.19, Version 0.10.25 (Stable), d778dc588507588b12b9f9d2905078db542ed751
Changes since version 0.10.24:
* stream: start thread after assignments (Oguz Bastemur)
* unix: correct error when calling uv_shutdown twice (Saúl Ibarra Corretgé)
2014.01.30, Version 0.10.24 (Stable), aecd296b6bce9b40f06a61c5c94e43d45ac7308a
Changes since version 0.10.23:
* linux: move sscanf() out of the assert() (Trevor Norris)
* linux: fix C99/C++ comment (Fedor Indutny)
libuv/ChangeLog view on Meta::CPAN
* unix: fix reopened fd bug (Fedor Indutny)
* core: fix fake watcher list and count preservation (Fedor Indutny)
2013.10.30, Version 0.11.14 (Unstable), d7a6482f45c1b4eb4a853dbe1a9ce8090a35633a
Changes since version 0.11.13:
* darwin: create fsevents thread on demand (Ben Noordhuis)
* fsevents: FSEvents is most likely not thread-safe (Fedor Indutny)
* fsevents: use shared FSEventStream (Fedor Indutny)
* windows: make uv_fs_chmod() report errors correctly (Bert Belder)
* windows: make uv_shutdown() for write-only pipes work (Bert Belder)
* windows/fs: wrap multi-statement macros in do..while block (Bert Belder)
* windows/fs: make uv_fs_open() report EINVAL correctly (Bert Belder)
libuv/ChangeLog view on Meta::CPAN
* include: update uv_is_active() documentation (Ben Noordhuis)
* include: make uv_process_options_t.cwd const (Ben Noordhuis)
* unix: wrap long lines at 80 columns (Ben Noordhuis)
* unix, windows: make uv_is_*() always return 0 or 1 (Ben Noordhuis)
* bench: measure total/init/dispatch/cleanup times (Ben Noordhuis)
* build: use -pthread on sunos (Timothy J. Fontaine)
* windows: remove duplicate check in stream.c (Ben Noordhuis)
* unix: sanity-check fds before closing (Ben Noordhuis)
* unix: remove uv__pipe_accept() (Ben Noordhuis)
* unix: fix uv_spawn() NULL pointer deref on ENOMEM (Ben Noordhuis)
* unix: don't close inherited fds on uv_spawn() fail (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* windows: fix stray comments (Ben Noordhuis)
* windows: remove unused is_path_dir() function (Ben Noordhuis)
2013.08.30, Version 0.11.11 (Unstable), ba876d53539ed0427c52039012419cd9374c6f0d
Changes since version 0.11.10:
* unix, windows: add thread-local storage API (Ben Noordhuis)
* linux: don't turn on SO_REUSEPORT socket option (Ben Noordhuis)
* darwin: fix 10.6 build error in fsevents.c (Ben Noordhuis)
* windows: make uv_shutdown() for write-only pipes work (Bert Belder)
* include: update uv_udp_open() / uv_udp_bind() docs (Ben Noordhuis)
* unix: req queue must be empty when destroying loop (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* process: make uv_spawn() return some types of errors immediately on windows,
instead of passing the error code the the exit callback. This brings it on
par with libuv's behavior on unix. (Bert Belder)
2013.08.24, Version 0.10.15 (Stable), 221078a8fdd9b853c6b557b3d9a5dd744b4fdd6b
Changes since version 0.10.14:
* fsevents: create FSEvents thread on demand (Ben Noordhuis)
* fsevents: use a single thread for interacting with FSEvents, because it's not
thread-safe. (Fedor Indutny)
* fsevents: share FSEventStream between multiple FS watchers, which removes a
limit on the maximum number of file watchers that can be created on OS X.
(Fedor Indutny)
2013.08.22, Version 0.11.8 (Unstable), a5260462db80ab0deab6b9e6a8991dd8f5a9a2f8
Changes since version 0.11.7:
libuv/ChangeLog view on Meta::CPAN
* sunos: remove futimes() macro (Ben Noordhuis)
* unix: fix uv__signal_unlock() prototype (Ben Noordhuis)
* unix, windows: allow NULL async callback (Ben Noordhuis)
* build: apply dtrace -G to all object files (Timothy J. Fontaine)
* darwin: fix indentation in uv__hrtime() (Ben Noordhuis)
* darwin: create fsevents thread on demand (Ben Noordhuis)
* darwin: reduce fsevents thread stack size (Ben Noordhuis)
* darwin: call pthread_setname_np() if available (Ben Noordhuis)
* build: fix automake serial-tests check again (Ben Noordhuis)
* unix: retry waitpid() on EINTR (Ben Noordhuis)
* darwin: fix ios build error (Ben Noordhuis)
* darwin: fix ios compiler warning (Ben Noordhuis)
* test: simplify test-ip6-addr.c (Ben Noordhuis)
* unix, windows: fix ipv6 link-local address parsing (Ben Noordhuis)
* fsevents: FSEvents is most likely not thread-safe (Fedor Indutny)
* windows: omit stdint.h, fix msvc 2008 build error (Ben Noordhuis)
2013.08.22, Version 0.10.14 (Stable), 15d64132151c18b26346afa892444b95e2addad0
Changes since version 0.10.13:
* unix: retry waitpid() on EINTR (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* unix: unconditionally stop handle on close (Ben Noordhuis)
* freebsd: don't enable dtrace if it's not available (Brian White)
* build: make HAVE_DTRACE=0 should disable dtrace (Timothy J. Fontaine)
* unix: remove overzealous assert (Ben Noordhuis)
* unix: remove unused function uv_fatal_error() (Ben Noordhuis)
* unix, windows: clean up uv_thread_create() (Ben Noordhuis)
* queue: fix pointer truncation on LLP64 platforms (Bert Belder)
* build: set OS=="android" for android builds (Linus MÃ¥rtensson)
* windows: don't use uppercase in include filename (Ben Noordhuis)
* stream: add an API to make streams do blocking writes (Henry Rawas)
* windows: use WSAGetLastError(), not errno (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* darwin: use uv_fs_sendfile() use the sendfile api correctly (Wynn Wilkes)
2013.05.30, Version 0.11.4 (Unstable), e43e5b3d954a0989db5588aa110e1fe4fe6e0219
Changes since version 0.11.3:
* windows: make uv_spawn not fail when the libuv embedding application is run
under external job control (Bert Belder)
* darwin: assume CFRunLoopStop() isn't thread-safe, fixing a race condition
when stopping the 'stdin select hack' thread (Fedor Indutny)
* win: fix UV_EALREADY not being reported correctly to the libuv user in some
cases (Bert Belder)
* darwin: make the uv__cf_loop_runner and uv__cf_loop_cb functions static (Ben
Noordhuis)
* darwin: task_info() cannot fail (Ben Noordhuis)
* unix: add error mapping for ENETDOWN (Ben Noordhuis)
libuv/ChangeLog view on Meta::CPAN
* unix: stop stream POLLOUT watcher on write error (Ben Noordhuis)
2013.05.25, Version 0.10.8 (Stable), 0f39be12926fe2d8766a9f025797a473003e6504
Changes since version 0.10.7:
* windows: make uv_spawn not fail under job control (Bert Belder)
* darwin: assume CFRunLoopStop() isn't thread-safe (Fedor Indutny)
* win: fix UV_EALREADY incorrectly set (Bert Belder)
* darwin: make two uv__cf_*() functions static (Ben Noordhuis)
* darwin: task_info() cannot fail (Ben Noordhuis)
* unix: add mapping for ENETDOWN (Ben Noordhuis)
* unix: implicitly signal write errors to libuv user (Ben Noordhuis)
libuv/LICENSE view on Meta::CPAN
- tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license.
- inet_pton and inet_ntop implementations, contained in src/inet.c, are
copyright the Internet Systems Consortium, Inc., and licensed under the ISC
license.
- stdint-msvc2008.h (from msinttypes), copyright Alexander Chemeris. Three
clause BSD license.
- pthread-fixes.c, copyright Google Inc. and Sony Mobile Communications AB.
Three clause BSD license.
- android-ifaddrs.h, android-ifaddrs.c, copyright Berkeley Software Design
Inc, Kenneth MacKay and Emergya (Cloud4all, FP7/2007-2013, grant agreement
n° 289016). Three clause BSD license.
libuv/Makefile.am view on Meta::CPAN
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/src
include_HEADERS=include/uv.h
uvincludedir = $(includedir)/uv
uvinclude_HEADERS = include/uv/errno.h \
include/uv/threadpool.h \
include/uv/version.h
CLEANFILES =
lib_LTLIBRARIES = libuv.la
libuv_la_CFLAGS = @CFLAGS@
libuv_la_LDFLAGS = -no-undefined -version-info 1:0:0
libuv_la_SOURCES = src/fs-poll.c \
src/heap-inl.h \
src/idna.c \
src/idna.h \
src/inet.c \
src/queue.h \
src/strscpy.c \
src/strscpy.h \
src/threadpool.c \
src/timer.c \
src/uv-data-getter-setters.c \
src/uv-common.c \
src/uv-common.h \
src/version.c
if SUNOS
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
# on other platforms complain that the argument is unused during compilation.
libuv_la_CFLAGS += -pthreads
endif
if WINNT
uvinclude_HEADERS += include/uv/win.h include/uv/tree.h
AM_CPPFLAGS += -I$(top_srcdir)/src/win \
-DWIN32_LEAN_AND_MEAN \
-D_WIN32_WINNT=0x0600
libuv_la_SOURCES += src/win/async.c \
src/win/atomicops-inl.h \
libuv/Makefile.am view on Meta::CPAN
src/win/loop-watcher.c \
src/win/pipe.c \
src/win/poll.c \
src/win/process-stdio.c \
src/win/process.c \
src/win/req-inl.h \
src/win/signal.c \
src/win/stream.c \
src/win/stream-inl.h \
src/win/tcp.c \
src/win/thread.c \
src/win/tty.c \
src/win/udp.c \
src/win/util.c \
src/win/winapi.c \
src/win/winapi.h \
src/win/winsock.c \
src/win/winsock.h
else # WINNT
libuv/Makefile.am view on Meta::CPAN
src/unix/internal.h \
src/unix/loop-watcher.c \
src/unix/loop.c \
src/unix/pipe.c \
src/unix/poll.c \
src/unix/process.c \
src/unix/signal.c \
src/unix/spinlock.h \
src/unix/stream.c \
src/unix/tcp.c \
src/unix/thread.c \
src/unix/tty.c \
src/unix/udp.c
endif # WINNT
EXTRA_DIST = test/fixtures/empty_file \
test/fixtures/load_error.node \
include \
docs \
img \
libuv/Makefile.am view on Meta::CPAN
check_PROGRAMS = test/run-tests
if OS390
test_run_tests_CFLAGS =
else
test_run_tests_CFLAGS = -Wno-long-long
endif
if SUNOS
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
# on other platforms complain that the argument is unused during compilation.
test_run_tests_CFLAGS += -pthreads
endif
test_run_tests_LDFLAGS =
test_run_tests_SOURCES = test/blackhole-server.c \
test/dns-server.c \
test/echo-server.c \
test/run-tests.c \
test/runner.c \
test/runner.h \
test/task.h \
libuv/Makefile.am view on Meta::CPAN
test/test-pipe-set-non-blocking.c \
test/test-pipe-set-fchmod.c \
test/test-platform-output.c \
test/test-poll.c \
test/test-poll-close.c \
test/test-poll-close-doesnt-corrupt-stack.c \
test/test-poll-closesocket.c \
test/test-poll-oob.c \
test/test-process-priority.c \
test/test-process-title.c \
test/test-process-title-threadsafe.c \
test/test-queue-foreach-delete.c \
test/test-ref.c \
test/test-run-nowait.c \
test/test-run-once.c \
test/test-semaphore.c \
test/test-shutdown-close.c \
test/test-shutdown-eof.c \
test/test-shutdown-twice.c \
test/test-signal-multiple-loops.c \
test/test-signal.c \
libuv/Makefile.am view on Meta::CPAN
test/test-tcp-read-stop.c \
test/test-tcp-shutdown-after-write.c \
test/test-tcp-unexpected-read.c \
test/test-tcp-oob.c \
test/test-tcp-write-to-half-open-connection.c \
test/test-tcp-write-after-connect.c \
test/test-tcp-writealot.c \
test/test-tcp-write-fail.c \
test/test-tcp-try-write.c \
test/test-tcp-write-queue-order.c \
test/test-thread-equal.c \
test/test-thread.c \
test/test-threadpool-cancel.c \
test/test-threadpool.c \
test/test-timer-again.c \
test/test-timer-from-check.c \
test/test-timer.c \
test/test-tmpdir.c \
test/test-tty-duplicate-key.c \
test/test-tty.c \
test/test-udp-alloc-cb-fail.c \
test/test-udp-bind.c \
test/test-udp-connect.c \
test/test-udp-create-socket-early.c \
libuv/Makefile.am view on Meta::CPAN
-D_LINUX_SOURCE_COMPAT \
-D_THREAD_SAFE \
-DHAVE_SYS_AHAFS_EVPRODS_H
uvinclude_HEADERS += include/uv/aix.h
libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
endif
if ANDROID
uvinclude_HEADERS += include/uv/android-ifaddrs.h
libuv_la_SOURCES += src/unix/android-ifaddrs.c \
src/unix/pthread-fixes.c
endif
if CYGWIN
uvinclude_HEADERS += include/uv/posix.h
libuv_la_CFLAGS += -D_GNU_SOURCE
libuv_la_SOURCES += src/unix/cygwin.c \
src/unix/bsd-ifaddrs.c \
src/unix/no-fsevents.c \
src/unix/no-proctitle.c \
src/unix/posix-hrtime.c \
libuv/Makefile.am view on Meta::CPAN
-D_ALL_SOURCE \
-D_LARGE_TIME_API \
-D_OPEN_SYS_SOCK_IPV6 \
-D_OPEN_SYS_FILE_EXT \
-DUV_PLATFORM_SEM_T=int \
-DPATH_MAX=255 \
-qCHARS=signed \
-qXPLINK \
-qFLOAT=IEEE
libuv_la_LDFLAGS += -qXPLINK
libuv_la_SOURCES += src/unix/pthread-fixes.c \
src/unix/os390.c \
src/unix/os390-syscalls.c \
src/unix/proctitle.c
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = @PACKAGE_NAME@.pc
libuv/common.gypi view on Meta::CPAN
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x32"', {
'cflags': [ '-mx32' ],
'ldflags': [ '-mx32' ],
}],
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
[ 'OS=="solaris"', {
'cflags': [ '-pthreads' ],
'ldflags': [ '-pthreads' ],
}],
[ 'OS not in "solaris android zos"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
}],
[ 'OS=="aix" and target_arch=="ppc64"', {
'cflags': [ '-maix64' ],
'ldflags': [ '-maix64' ],
}],
],
}],
['OS=="mac"', {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'USE_HEADERMAP': 'NO',
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
},
libuv/configure.ac view on Meta::CPAN
CC_CHECK_CFLAGS_APPEND([-Wall])
CC_CHECK_CFLAGS_APPEND([-Wextra])
CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter])
CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes])
# AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# autoconf complains if AC_PROG_LIBTOOL precedes AM_PROG_AR.
AC_PROG_LIBTOOL
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
LT_INIT
# TODO(bnoordhuis) Check for -pthread vs. -pthreads
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([kstat], [kstat_lookup])
AC_CHECK_LIB([nsl], [gethostbyname])
AC_CHECK_LIB([perfstat], [perfstat_cpu])
AC_CHECK_LIB([pthread], [pthread_mutex_init])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_LIB([sendfile], [sendfile])
AC_CHECK_LIB([socket], [socket])
AC_SYS_LARGEFILE
AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])])
AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])])
AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false])])
AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])])
AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])])
AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])])
libuv/docs/code/locks/main.c view on Meta::CPAN
uv_barrier_wait(&blocker);
}
int main()
{
uv_barrier_init(&blocker, 4);
shared_num = 0;
uv_rwlock_init(&numlock);
uv_thread_t threads[3];
int thread_nums[] = {1, 2, 1};
uv_thread_create(&threads[0], reader, &thread_nums[0]);
uv_thread_create(&threads[1], reader, &thread_nums[1]);
uv_thread_create(&threads[2], writer, &thread_nums[2]);
uv_barrier_wait(&blocker);
uv_barrier_destroy(&blocker);
uv_rwlock_destroy(&numlock);
return 0;
}
libuv/docs/code/signal/main.c view on Meta::CPAN
return loop;
}
void signal_handler(uv_signal_t *handle, int signum)
{
printf("Signal received: %d\n", signum);
uv_signal_stop(handle);
}
// two signal handlers in one loop
void thread1_worker(void *userp)
{
uv_loop_t *loop1 = create_loop();
uv_signal_t sig1a, sig1b;
uv_signal_init(loop1, &sig1a);
uv_signal_start(&sig1a, signal_handler, SIGUSR1);
uv_signal_init(loop1, &sig1b);
uv_signal_start(&sig1b, signal_handler, SIGUSR1);
uv_run(loop1, UV_RUN_DEFAULT);
}
// two signal handlers, each in its own loop
void thread2_worker(void *userp)
{
uv_loop_t *loop2 = create_loop();
uv_loop_t *loop3 = create_loop();
uv_signal_t sig2;
uv_signal_init(loop2, &sig2);
uv_signal_start(&sig2, signal_handler, SIGUSR1);
uv_signal_t sig3;
uv_signal_init(loop3, &sig3);
uv_signal_start(&sig3, signal_handler, SIGUSR1);
while (uv_run(loop2, UV_RUN_NOWAIT) || uv_run(loop3, UV_RUN_NOWAIT)) {
}
}
int main()
{
printf("PID %d\n", getpid());
uv_thread_t thread1, thread2;
uv_thread_create(&thread1, thread1_worker, 0);
uv_thread_create(&thread2, thread2_worker, 0);
uv_thread_join(&thread1);
uv_thread_join(&thread2);
return 0;
}
libuv/docs/code/thread-create/main.c view on Meta::CPAN
while (tracklen) {
tracklen--;
fprintf(stderr, "Tortoise ran another step\n");
sleep(3);
}
fprintf(stderr, "Tortoise done running!\n");
}
int main() {
int tracklen = 10;
uv_thread_t hare_id;
uv_thread_t tortoise_id;
uv_thread_create(&hare_id, hare, &tracklen);
uv_thread_create(&tortoise_id, tortoise, &tracklen);
uv_thread_join(&hare_id);
uv_thread_join(&tortoise_id);
return 0;
}
libuv/docs/src/api.rst view on Meta::CPAN
signal
process
stream
tcp
pipe
tty
udp
fs_event
fs_poll
fs
threadpool
dns
dll
threading
misc
libuv/docs/src/async.rst view on Meta::CPAN
.. _async:
:c:type:`uv_async_t` --- Async handle
=====================================
Async handles allow the user to "wakeup" the event loop and get a callback
called from another thread.
Data types
----------
.. c:type:: uv_async_t
Async handle type.
.. c:type:: void (*uv_async_cb)(uv_async_t* handle)
libuv/docs/src/async.rst view on Meta::CPAN
.. note::
Unlike other handle initialization functions, it immediately starts the handle.
.. c:function:: int uv_async_send(uv_async_t* async)
Wake up the event loop and call the async handle's callback.
:returns: 0 on success, or an error code < 0 on failure.
.. note::
It's safe to call this function from any thread. The callback will be called on the
loop thread.
.. warning::
libuv will coalesce calls to :c:func:`uv_async_send`, that is, not every call to it will
yield an execution of the callback. For example: if :c:func:`uv_async_send` is called 5
times in a row before the callback is called, the callback will only be called once. If
:c:func:`uv_async_send` is called again after the callback was called, it will be called
again.
.. seealso::
The :c:type:`uv_handle_t` API functions also apply.
libuv/docs/src/design.rst view on Meta::CPAN
.. _design:
Design overview
===============
libuv is cross-platform support library which was originally written for NodeJS. It's designed
around the event-driven asynchronous I/O model.
The library provides much more than a simple abstraction over different I/O polling mechanisms:
'handles' and 'streams' provide a high level abstraction for sockets and other entities;
cross-platform file I/O and threading functionality is also provided, amongst other things.
Here is a diagram illustrating the different parts that compose libuv and what subsystem they
relate to:
.. image:: static/architecture.png
:scale: 75%
:align: center
Handles and requests
libuv/docs/src/design.rst view on Meta::CPAN
Requests represent (typically) short-lived operations. These operations can be performed over a
handle: write requests are used to write data on a handle; or standalone: getaddrinfo requests
don't need a handle they run directly on the loop.
The I/O loop
^^^^^^^^^^^^
The I/O (or event) loop is the central part of libuv. It establishes the content for all I/O
operations, and it's meant to be tied to a single thread. One can run multiple event loops
as long as each runs in a different thread. The libuv event loop (or any other API involving
the loop or handles, for that matter) **is not thread-safe** except where stated otherwise.
The event loop follows the rather usual single threaded asynchronous I/O approach: all (network)
I/O is performed on non-blocking sockets which are polled using the best mechanism available
on the given platform: epoll on Linux, kqueue on OSX and other BSDs, event ports on SunOS and IOCP
on Windows. As part of a loop iteration the loop will block waiting for I/O activity on sockets
which have been added to the poller and callbacks will be fired indicating socket conditions
(readable, writable hangup) so handles can read, write or perform the desired I/O operation.
In order to better understand how the event loop operates, the following diagram illustrates all
stages of a loop iteration:
.. image:: static/loop_iteration.png
libuv/docs/src/design.rst view on Meta::CPAN
#. Special case in case the loop was run with ``UV_RUN_ONCE``, as it implies forward progress.
It's possible that no I/O callbacks were fired after blocking for I/O, but some time has passed
so there might be timers which are due, those timers get their callbacks called.
#. Iteration ends. If the loop was run with ``UV_RUN_NOWAIT`` or ``UV_RUN_ONCE`` modes the
iteration ends and :c:func:`uv_run` will return. If the loop was run with ``UV_RUN_DEFAULT``
it will continue from the start if it's still *alive*, otherwise it will also end.
.. important::
libuv uses a thread pool to make asynchronous file I/O operations possible, but
network I/O is **always** performed in a single thread, each loop's thread.
.. note::
While the polling mechanism is different, libuv makes the execution model consistent
across Unix systems and Windows.
File I/O
^^^^^^^^
Unlike network I/O, there are no platform-specific file I/O primitives libuv could rely on,
so the current approach is to run blocking file I/O operations in a thread pool.
For a thorough explanation of the cross-platform file I/O landscape, checkout
`this post <http://blog.libtorrent.org/2012/10/asynchronous-disk-io/>`_.
libuv currently uses a global thread pool on which all loops can queue work. 3 types of
operations are currently run on this pool:
* File system operations
* DNS functions (getaddrinfo and getnameinfo)
* User specified code via :c:func:`uv_queue_work`
.. warning::
See the :c:ref:`threadpool` section for more details, but keep in mind the thread pool size
is quite limited.
libuv/docs/src/fs.rst view on Meta::CPAN
.. _fs:
File system operations
======================
libuv provides a wide variety of cross-platform sync and async file system
operations. All functions defined in this document take a callback, which is
allowed to be NULL. If the callback is NULL the request is completed synchronously,
otherwise it will be performed asynchronously.
All file operations are run on the threadpool. See :ref:`threadpool` for information
on the threadpool size.
.. note::
On Windows `uv_fs_*` functions use utf-8 encoding.
Data types
----------
.. c:type:: uv_fs_t
File system request type.
libuv/docs/src/fs.rst view on Meta::CPAN
must set `dir->dirents` and `dir->nentries`, representing the array of
:c:type:`uv_dirent_t` elements used to hold the read directory entries and
its size.
On success, the result is an integer >= 0 representing the number of entries
read from the stream.
.. versionadded:: 1.28.0
.. warning::
`uv_fs_readdir()` is not thread safe.
.. note::
This function does not return the "." and ".." entries.
.. note::
On success this function allocates memory that must be freed using
`uv_fs_req_cleanup()`.
.. c:function:: int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_cb cb)
.. c:function:: int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent)
libuv/docs/src/fs_event.rst view on Meta::CPAN
===========================================
FS Event handles allow the user to monitor a given path for changes, for example,
if the file was renamed or there was a generic change in it. This handle uses
the best backend for the job on each platform.
.. note::
For AIX, the non default IBM bos.ahafs package has to be installed.
The AIX Event Infrastructure file system (ahafs) has some limitations:
- ahafs tracks monitoring per process and is not thread safe. A separate process
must be spawned for each monitor for the same event.
- Events for file modification (writing to a file) are not received if only the
containing folder is watched.
See documentation_ for more details.
The z/OS file system events monitoring infrastructure does not notify of file
creation/deletion within a directory that is being monitored.
See the `IBM Knowledge centre`_ for more details.
libuv/docs/src/guide.rst view on Meta::CPAN
and it hasn't gone through thorough review yet. If you spot a mistake please file an
issue, or better yet, open a pull request!
.. toctree::
:maxdepth: 2
guide/introduction
guide/basics
guide/filesystem
guide/networking
guide/threads
guide/processes
guide/eventloops
guide/utilities
guide/about
libuv/docs/src/guide/basics.rst view on Meta::CPAN
The most common activity of systems programs is to deal with input and output,
rather than a lot of number-crunching. The problem with using conventional
input/output functions (``read``, ``fprintf``, etc.) is that they are
**blocking**. The actual write to a hard disk or reading from a network, takes
a disproportionately long time compared to the speed of the processor. The
functions don't return until the task is done, so that your program is doing
nothing. For programs which require high performance this is a major roadblock
as other activities and other I/O operations are kept waiting.
One of the standard solutions is to use threads. Each blocking I/O operation is
started in a separate thread (or in a thread pool). When the blocking function
gets invoked in the thread, the processor can schedule another thread to run,
which actually needs the CPU.
The approach followed by libuv uses another style, which is the **asynchronous,
non-blocking** style. Most modern operating systems provide event notification
subsystems. For example, a normal ``read`` call on a socket would block until
the sender actually sent something. Instead, the application can request the
operating system to watch the socket and put an event notification in the
queue. The application can inspect the events at its convenience (perhaps doing
some number crunching before to use the processor to the maximum) and grab the
data. It is **asynchronous** because the application expressed interest at one
point, then used the data at another point (in time and space). It is
**non-blocking** because the application process was free to do other tasks.
This fits in well with libuv's event-loop approach, since the operating system
events can be treated as just another libuv event. The non-blocking ensures
that other events can continue to be handled as fast as they come in [#]_.
.. NOTE::
How the I/O is run in the background is not of our concern, but due to the
way our computer hardware works, with the thread as the basic unit of the
processor, libuv and OSes will usually run background/worker threads and/or
polling to perform tasks in a non-blocking manner.
Bert Belder, one of the libuv core developers has a small video explaining the
architecture of libuv and its background. If you have no prior experience with
either libuv or libev, it is a quick, useful watch.
libuv's event loop is explained in more detail in the `documentation
<http://docs.libuv.org/en/v1.x/design.html#the-i-o-loop>`_.
.. raw:: html
libuv/docs/src/guide/filesystem.rst view on Meta::CPAN
==========
Simple filesystem read/write is achieved using the ``uv_fs_*`` functions and the
``uv_fs_t`` struct.
.. note::
The libuv filesystem operations are different from :doc:`socket operations
<networking>`. Socket operations use the non-blocking operations provided
by the operating system. Filesystem operations use blocking functions
internally, but invoke these functions in a `thread pool`_ and notify
watchers registered with the event loop when application interaction is
required.
.. _thread pool: http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling
All filesystem functions have two forms - *synchronous* and *asynchronous*.
The *synchronous* forms automatically get called (and **block**) if the
callback is null. The return value of functions is a :ref:`libuv error code
<libuv-error-handling>`. This is usually only useful for synchronous calls.
The *asynchronous* form is called when a callback is passed and the return
value is 0.
Reading/Writing files
libuv/docs/src/guide/networking.rst view on Meta::CPAN
.. _getaddrinfo: http://www.kernel.org/doc/man-pages/online/pages/man3/getaddrinfo.3.html
.. _User Datagram Protocol: http://en.wikipedia.org/wiki/User_Datagram_Protocol
.. _DHCP: http://tools.ietf.org/html/rfc2131
----
.. [#] http://beej.us/guide/bgnet/output/html/multipage/advanced.html#broadcast
.. [#] on Windows only supported on Windows Vista and later.
.. [#] http://www.tldp.org/HOWTO/Multicast-HOWTO-6.html#ss6.1
.. [#] libuv use the system ``getaddrinfo`` in the libuv threadpool. libuv
v0.8.0 and earlier also included c-ares_ as an alternative, but this has been
removed in v0.9.0.
libuv/docs/src/guide/processes.rst view on Meta::CPAN
Processes
=========
libuv offers considerable child process management, abstracting the platform
differences and allowing communication with the child process using streams or
named pipes.
A common idiom in Unix is for every process to do one thing and do it well. In
such a case, a process often uses multiple child processes to achieve tasks
(similar to using pipes in shells). A multi-process model with messages
may also be easier to reason about compared to one with threads and shared
memory.
A common refrain against event-based programs is that they cannot take
advantage of multiple cores in modern computers. In a multi-threaded program
the kernel can perform scheduling and assign different threads to different
cores, improving performance. But an event loop has only one thread. The
workaround can be to launch multiple processes instead, with each process
running an event loop, and each process getting assigned to a separate CPU
core.
Spawning child processes
------------------------
The simplest case is when you simply want to launch a process and know when it
exits. This is achieved using ``uv_spawn``.
libuv/docs/src/guide/threads.rst view on Meta::CPAN
Threads
=======
Wait a minute? Why are we on threads? Aren't event loops supposed to be **the
way** to do *web-scale programming*? Well... no. Threads are still the medium in
which processors do their jobs. Threads are therefore mighty useful sometimes, even
though you might have to wade through various synchronization primitives.
Threads are used internally to fake the asynchronous nature of all of the system
calls. libuv also uses threads to allow you, the application, to perform a task
asynchronously that is actually blocking, by spawning a thread and collecting
the result when it is done.
Today there are two predominant thread libraries: the Windows threads
implementation and POSIX's `pthreads`_. libuv's thread API is analogous to
the pthreads API and often has similar semantics.
A notable aspect of libuv's thread facilities is that it is a self contained
section within libuv. Whereas other features intimately depend on the event
loop and callback principles, threads are complete agnostic, they block as
required, signal errors directly via return values, and, as shown in the
:ref:`first example <thread-create-example>`, don't even require a running
event loop.
libuv's thread API is also very limited since the semantics and syntax of
threads are different on all platforms, with different levels of completeness.
This chapter makes the following assumption: **There is only one event loop,
running in one thread (the main thread)**. No other thread interacts
with the event loop (except using ``uv_async_send``).
Core thread operations
----------------------
There isn't much here, you just start a thread using ``uv_thread_create()`` and
wait for it to close using ``uv_thread_join()``.
.. _thread-create-example:
.. rubric:: thread-create/main.c
.. literalinclude:: ../../code/thread-create/main.c
:linenos:
:lines: 26-36
:emphasize-lines: 3-7
.. tip::
``uv_thread_t`` is just an alias for ``pthread_t`` on Unix, but this is an
implementation detail, avoid depending on it to always be true.
The second parameter is the function which will serve as the entry point for
the thread, the last parameter is a ``void *`` argument which can be used to pass
custom parameters to the thread. The function ``hare`` will now run in a separate
thread, scheduled pre-emptively by the operating system:
.. rubric:: thread-create/main.c
.. literalinclude:: ../../code/thread-create/main.c
:linenos:
:lines: 6-14
:emphasize-lines: 2
Unlike ``pthread_join()`` which allows the target thread to pass back a value to
the calling thread using a second parameter, ``uv_thread_join()`` does not. To
send values use :ref:`inter-thread-communication`.
Synchronization Primitives
--------------------------
This section is purposely spartan. This book is not about threads, so I only
catalogue any surprises in the libuv APIs here. For the rest you can look at
the pthreads `man pages <pthreads>`_.
Mutexes
~~~~~~~
The mutex functions are a **direct** map to the pthread equivalents.
.. rubric:: libuv mutex functions
.. literalinclude:: ../../../include/uv.h
:lines: 1355-1360
The ``uv_mutex_init()``, ``uv_mutex_init_recursive()`` and ``uv_mutex_trylock()``
functions will return 0 on success, and an error code otherwise.
If `libuv` has been compiled with debugging enabled, ``uv_mutex_destroy()``,
``uv_mutex_lock()`` and ``uv_mutex_unlock()`` will ``abort()`` on error.
Similarly ``uv_mutex_trylock()`` will abort if the error is anything *other
than* ``EAGAIN`` or ``EBUSY``.
Recursive mutexes are supported, but you should not rely on them. Also, they
should not be used with ``uv_cond_t`` variables.
The default BSD mutex implementation will raise an error if a thread which has
locked a mutex attempts to lock it again. For example, a construct like::
uv_mutex_init(a_mutex);
uv_mutex_lock(a_mutex);
uv_thread_create(thread_id, entry, (void *)a_mutex);
uv_mutex_lock(a_mutex);
// more things here
can be used to wait until another thread initializes some stuff and then
unlocks ``a_mutex`` but will lead to your program crashing if in debug mode, or
return an error in the second call to ``uv_mutex_lock()``.
.. note::
Mutexes on Windows are always recursive.
Locks
~~~~~
libuv/docs/src/guide/threads.rst view on Meta::CPAN
.. rubric:: locks/main.c - simple rwlocks
.. literalinclude:: ../../code/locks/main.c
:linenos:
:emphasize-lines: 13,16,27,31,42,55
Run this and observe how the readers will sometimes overlap. In case of
multiple writers, schedulers will usually give them higher priority, so if you
add two writers, you'll see that both writers tend to finish first before the
readers get a chance again.
We also use barriers in the above example so that the main thread can wait for
all readers and writers to indicate they have ended.
Others
~~~~~~
libuv also supports semaphores_, `condition variables`_ and barriers_ with APIs
very similar to their pthread counterparts.
.. _semaphores: http://en.wikipedia.org/wiki/Semaphore_(programming)
.. _condition variables: http://en.wikipedia.org/wiki/Condition_variable#Waiting_and_signaling
.. _barriers: http://en.wikipedia.org/wiki/Barrier_(computer_science)
In addition, libuv provides a convenience function ``uv_once()``. Multiple
threads can attempt to call ``uv_once()`` with a given guard and a function
pointer, **only the first one will win, the function will be called once and
only once**::
/* Initialize guard */
static uv_once_t once_only = UV_ONCE_INIT;
int i = 0;
void increment() {
i++;
}
void thread1() {
/* ... work */
uv_once(once_only, increment);
}
void thread2() {
/* ... work */
uv_once(once_only, increment);
}
int main() {
/* ... spawn threads */
}
After all threads are done, ``i == 1``.
.. _libuv-work-queue:
libuv v0.11.11 onwards also added a ``uv_key_t`` struct and api_ for
thread-local storage.
.. _api: http://docs.libuv.org/en/v1.x/threading.html#thread-local-storage
libuv work queue
----------------
``uv_queue_work()`` is a convenience function that allows an application to run
a task in a separate thread, and have a callback that is triggered when the
task is done. A seemingly simple function, what makes ``uv_queue_work()``
tempting is that it allows potentially any third-party libraries to be used
with the event-loop paradigm. When you use event loops, it is *imperative to
make sure that no function which runs periodically in the loop thread blocks
when performing I/O or is a serious CPU hog*, because this means that the loop
slows down and events are not being handled at full capacity.
However, a lot of existing code out there features blocking functions (for example
a routine which performs I/O under the hood) to be used with threads if you
want responsiveness (the classic 'one thread per client' server model), and
getting them to play with an event loop library generally involves rolling your
own system of running the task in a separate thread. libuv just provides
a convenient abstraction for this.
Here is a simple example inspired by `node.js is cancer`_. We are going to
calculate fibonacci numbers, sleeping a bit along the way, but run it in
a separate thread so that the blocking and CPU bound task does not prevent the
event loop from performing other activities.
.. rubric:: queue-work/main.c - lazy fibonacci
.. literalinclude:: ../../code/queue-work/main.c
:linenos:
:lines: 17-29
The actual task function is simple, nothing to show that it is going to be
run in a separate thread. The ``uv_work_t`` structure is the clue. You can pass
arbitrary data through it using the ``void* data`` field and use it to
communicate to and from the thread. But be sure you are using proper locks if
you are changing things while both threads may be running.
The trigger is ``uv_queue_work``:
.. rubric:: queue-work/main.c
.. literalinclude:: ../../code/queue-work/main.c
:linenos:
:lines: 31-44
:emphasize-lines: 10
The thread function will be launched in a separate thread, passed the
``uv_work_t`` structure and once the function returns, the *after* function
will be called on the thread the event loop is running in. It will be passed
the same structure.
For writing wrappers to blocking libraries, a common :ref:`pattern <baton>`
is to use a baton to exchange data.
Since libuv version `0.9.4` an additional function, ``uv_cancel()``, is
available. This allows you to cancel tasks on the libuv work queue. Only tasks
that *are yet to be started* can be cancelled. If a task has *already started
executing, or it has finished executing*, ``uv_cancel()`` **will fail**.
libuv/docs/src/guide/threads.rst view on Meta::CPAN
``uv_cancel()`` can also be used with ``uv_fs_t`` and ``uv_getaddrinfo_t``
requests. For the filesystem family of functions, ``uv_fs_t.errorno`` will be
set to ``UV_ECANCELED``.
.. TIP::
A well designed program would have a way to terminate long running workers
that have already started executing. Such a worker could periodically check
for a variable that only the main process sets to signal termination.
.. _inter-thread-communication:
Inter-thread communication
--------------------------
Sometimes you want various threads to actually send each other messages *while*
they are running. For example you might be running some long duration task in
a separate thread (perhaps using ``uv_queue_work``) but want to notify progress
to the main thread. This is a simple example of having a download manager
informing the user of the status of running downloads.
.. rubric:: progress/main.c
.. literalinclude:: ../../code/progress/main.c
:linenos:
:lines: 7-8,34-
:emphasize-lines: 2,11
The async thread communication works *on loops* so although any thread can be
the message sender, only threads with libuv loops can be receivers (or rather
the loop is the receiver). libuv will invoke the callback (``print_progress``)
with the async watcher whenever it receives a message.
.. warning::
It is important to realize that since the message send is *async*, the callback
may be invoked immediately after ``uv_async_send`` is called in another
thread, or it may be invoked after some time. libuv may also combine
multiple calls to ``uv_async_send`` and invoke your callback only once. The
only guarantee that libuv makes is -- The callback function is called *at
least once* after the call to ``uv_async_send``. If you have no pending
calls to ``uv_async_send``, the callback won't be called. If you make two
or more calls, and libuv hasn't had a chance to run the callback yet, it
*may* invoke your callback *only once* for the multiple invocations of
``uv_async_send``. Your callback will never be called twice for just one
event.
.. rubric:: progress/main.c
libuv/docs/src/guide/threads.rst view on Meta::CPAN
Finally it is important to remember to clean up the watcher.
.. rubric:: progress/main.c
.. literalinclude:: ../../code/progress/main.c
:linenos:
:lines: 25-28
:emphasize-lines: 3
After this example, which showed the abuse of the ``data`` field, bnoordhuis_
pointed out that using the ``data`` field is not thread safe, and
``uv_async_send()`` is actually only meant to wake up the event loop. Use
a mutex or rwlock to ensure accesses are performed in the right order.
.. note::
mutexes and rwlocks **DO NOT** work inside a signal handler, whereas
``uv_async_send`` does.
One use case where ``uv_async_send`` is required is when interoperating with
libraries that require thread affinity for their functionality. For example in
node.js, a v8 engine instance, contexts and its objects are bound to the thread
that the v8 instance was started in. Interacting with v8 data structures from
another thread can lead to undefined results. Now consider some node.js module
which binds a third party library. It may go something like this:
1. In node, the third party library is set up with a JavaScript callback to be
invoked for more information::
var lib = require('lib');
lib.on_progress(function() {
console.log("Progress");
});
lib.do();
// do other stuff
2. ``lib.do`` is supposed to be non-blocking but the third party lib is
blocking, so the binding uses ``uv_queue_work``.
3. The actual work being done in a separate thread wants to invoke the progress
callback, but cannot directly call into v8 to interact with JavaScript. So
it uses ``uv_async_send``.
4. The async callback, invoked in the main loop thread, which is the v8 thread,
then interacts with v8 to invoke the JavaScript callback.
.. _pthreads: http://man7.org/linux/man-pages/man7/pthreads.7.html
----
.. _node.js is cancer: http://teddziuba.github.io/2011/10/node-js-is-cancer.html
.. _bnoordhuis: https://github.com/bnoordhuis
libuv/docs/src/guide/utilities.rst view on Meta::CPAN
for a brief amount as the loop deals with the input data, after which it will
keep calling the idle callback again.
.. rubric:: idle-compute/main.c
.. literalinclude:: ../../code/idle-compute/main.c
:linenos:
:lines: 10-19
.. _baton:
Passing data to worker thread
-----------------------------
When using ``uv_queue_work`` you'll usually need to pass complex data through
to the worker thread. The solution is to use a ``struct`` and set
``uv_work_t.data`` to point to it. A slight variation is to have the
``uv_work_t`` itself as the first member of this struct (called a baton [#]_).
This allows cleaning up the work request and all the data in one free call.
.. code-block:: c
:linenos:
:emphasize-lines: 2
struct ftp_baton {
uv_work_t req;
libuv/docs/src/guide/utilities.rst view on Meta::CPAN
-------------------------
Usually third-party libraries will handle their own I/O, and keep track of
their sockets and other files internally. In this case it isn't possible to use
the standard stream I/O operations, but the library can still be integrated
into the libuv event loop. All that is required is that the library allow you
to access the underlying file descriptors and provide functions that process
tasks in small increments as decided by your application. Some libraries though
will not allow such access, providing only a standard blocking function which
will perform the entire I/O transaction and only then return. It is unwise to
use these in the event loop thread, use the :ref:`libuv-work-queue` instead. Of
course, this will also mean losing granular control on the library.
The ``uv_poll`` section of libuv simply watches file descriptors using the
operating system notification mechanism. In some sense, all the I/O operations
that libuv implements itself are also backed by ``uv_poll`` like code. Whenever
the OS notices a change of state in file descriptors being polled, libuv will
invoke the associated callback.
Here we will walk through a simple download manager that will use libcurl_ to
download files. Rather than give all control to libcurl, we'll instead be
libuv/docs/src/guide/utilities.rst view on Meta::CPAN
:linenos:
:lines: 81-95
:emphasize-lines: 2,6-7,12
The first thing we do is to stop the timer, since there has been some progress
in the interval. Then depending on what event triggered the callback, we set
the correct flags. Then we call ``curl_multi_socket_action`` with the socket
that progressed and the flags informing about what events happened. At this
point libcurl does all of its internal tasks in small increments, and will
attempt to return as fast as possible, which is exactly what an evented program
wants in its main thread. libcurl keeps queueing messages into its own queue
about transfer progress. In our case we are only interested in transfers that
are completed. So we extract these messages, and clean up handles whose
transfers are done.
.. rubric:: uvwget/main.c - Reading transfer status.
.. literalinclude:: ../../code/uvwget/main.c
:linenos:
:lines: 58-79
:emphasize-lines: 6,9-10,13-14
libuv/docs/src/loop.rst view on Meta::CPAN
Returns the initialized default loop. It may return NULL in case of
allocation failure.
This function is just a convenient way for having a global loop throughout
an application, the default loop is in no way different than the ones
initialized with :c:func:`uv_loop_init`. As such, the default loop can (and
should) be closed with :c:func:`uv_loop_close` so the resources associated
with it are freed.
.. warning::
This function is not thread safe.
.. c:function:: int uv_run(uv_loop_t* loop, uv_run_mode mode)
This function runs the event loop. It will act differently depending on the
specified mode:
- UV_RUN_DEFAULT: Runs the event loop until there are no more active and
referenced handles or requests. Returns non-zero if :c:func:`uv_stop`
was called and there are still active handles or requests. Returns
zero in all other cases.
libuv/docs/src/loop.rst view on Meta::CPAN
Returns the size of the `uv_loop_t` structure. Useful for FFI binding
writers who don't want to know the structure layout.
.. c:function:: int uv_backend_fd(const uv_loop_t* loop)
Get backend file descriptor. Only kqueue, epoll and event ports are
supported.
This can be used in conjunction with `uv_run(loop, UV_RUN_NOWAIT)` to
poll in one thread and run the event loop's callbacks in another see
test/test-embed.c for an example.
.. note::
Embedding a kqueue fd in another kqueue pollset doesn't work on all platforms. It's not
an error to add the fd but it never generates events.
.. c:function:: int uv_backend_timeout(const uv_loop_t* loop)
Get the poll timeout. The return value is in milliseconds, or -1 for no
timeout.
libuv/docs/src/migration_010_100.rst view on Meta::CPAN
... assume 'server' is a TCP server which is already listening
r = uv_listen((uv_stream_t*) server, 511, NULL);
if (r < 0) {
/* r contains UV_EADDRINUSE */
}
Threadpool changes
~~~~~~~~~~~~~~~~~~
In libuv 0.10 Unix used a threadpool which defaulted to 4 threads, while Windows used the
`QueueUserWorkItem` API, which uses a Windows internal threadpool, which defaults to 512
threads per process.
In 1.0, we unified both implementations, so Windows now uses the same implementation Unix
does. The threadpool size can be set by exporting the ``UV_THREADPOOL_SIZE`` environment
variable. See :c:ref:`threadpool`.
Allocation callback API change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In libuv 0.10 the callback had to return a filled :c:type:`uv_buf_t` by value:
::
uv_buf_t alloc_cb(uv_handle_t* handle, size_t size) {
libuv/docs/src/migration_010_100.rst view on Meta::CPAN
uv_fs_readdir rename and API change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`uv_fs_readdir` returned a list of strings in the `req->ptr` field upon completion in
libuv 0.10. In 1.0, this function got renamed to :c:func:`uv_fs_scandir`, since it's
actually implemented using ``scandir(3)``.
In addition, instead of allocating a full list strings, the user is able to get one
result at a time by using the :c:func:`uv_fs_scandir_next` function. This function
does not need to make a roundtrip to the threadpool, because libuv will keep the
list of *dents* returned by ``scandir(3)`` around.
libuv/docs/src/misc.rst view on Meta::CPAN
Store the program arguments. Required for getting / setting the process title.
.. c:function:: int uv_get_process_title(char* buffer, size_t size)
Gets the title of the current process. You *must* call `uv_setup_args`
before calling this function. If `buffer` is `NULL` or `size` is zero,
`UV_EINVAL` is returned. If `size` cannot accommodate the process title and
terminating `NULL` character, the function returns `UV_ENOBUFS`.
.. versionchanged:: 1.18.1 now thread-safe on all supported platforms.
.. c:function:: int uv_set_process_title(const char* title)
Sets the current process title. You *must* call `uv_setup_args` before
calling this function. On platforms with a fixed size buffer for the process
title the contents of `title` will be copied to the buffer and truncated if
larger than the available space. Other platforms will return `UV_ENOMEM` if
they cannot allocate enough space to duplicate the contents of `title`.
.. versionchanged:: 1.18.1 now thread-safe on all supported platforms.
.. c:function:: int uv_resident_set_memory(size_t* rss)
Gets the resident set size (RSS) for the current process.
.. c:function:: int uv_uptime(double* uptime)
Gets the current system uptime.
.. c:function:: int uv_getrusage(uv_rusage_t* rusage)
libuv/docs/src/misc.rst view on Meta::CPAN
`GetEnvironmentVariableW()`. If `USERPROFILE` is not set,
`GetUserProfileDirectoryW()` is called. On all other operating systems,
`uv_os_homedir()` first checks the `HOME` environment variable using
:man:`getenv(3)`. If `HOME` is not set, :man:`getpwuid_r(3)` is called. The
user's home directory is stored in `buffer`. When `uv_os_homedir()` is
called, `size` indicates the maximum size of `buffer`. On success `size` is set
to the string length of `buffer`. On `UV_ENOBUFS` failure `size` is set to the
required length for `buffer`, including the null byte.
.. warning::
`uv_os_homedir()` is not thread safe.
.. versionadded:: 1.6.0
.. c:function:: int uv_os_tmpdir(char* buffer, size_t* size)
Gets the temp directory. On Windows, `uv_os_tmpdir()` uses `GetTempPathW()`.
On all other operating systems, `uv_os_tmpdir()` uses the first environment
variable found in the ordered list `TMPDIR`, `TMP`, `TEMP`, and `TEMPDIR`.
If none of these are found, the path `"/tmp"` is used, or, on Android,
`"/data/local/tmp"` is used. The temp directory is stored in `buffer`. When
`uv_os_tmpdir()` is called, `size` indicates the maximum size of `buffer`.
On success `size` is set to the string length of `buffer` (which does not
include the terminating null). On `UV_ENOBUFS` failure `size` is set to the
required length for `buffer`, including the null byte.
.. warning::
`uv_os_tmpdir()` is not thread safe.
.. versionadded:: 1.9.0
.. c:function:: int uv_os_get_passwd(uv_passwd_t* pwd)
Gets a subset of the password file entry for the current effective uid (not
the real uid). The populated data includes the username, euid, gid, shell,
and home directory. On non-Windows systems, all data comes from
:man:`getpwuid_r(3)`. On Windows, uid and gid are set to -1 and have no
meaning, and shell is `NULL`. After successfully calling this function, the
libuv/docs/src/misc.rst view on Meta::CPAN
Retrieves the environment variable specified by `name`, copies its value
into `buffer`, and sets `size` to the string length of the value. When
calling this function, `size` must be set to the amount of storage available
in `buffer`, including the null terminator. If the environment variable
exceeds the storage available in `buffer`, `UV_ENOBUFS` is returned, and
`size` is set to the amount of storage required to hold the value. If no
matching environment variable exists, `UV_ENOENT` is returned.
.. warning::
This function is not thread safe.
.. versionadded:: 1.12.0
.. c:function:: int uv_os_setenv(const char* name, const char* value)
Creates or updates the environment variable specified by `name` with
`value`.
.. warning::
This function is not thread safe.
.. versionadded:: 1.12.0
.. c:function:: int uv_os_unsetenv(const char* name)
Deletes the environment variable specified by `name`. If no such environment
variable exists, this function returns successfully.
.. warning::
This function is not thread safe.
.. versionadded:: 1.12.0
.. c:function:: int uv_os_gethostname(char* buffer, size_t* size)
Returns the hostname as a null-terminated string in `buffer`, and sets
`size` to the string length of the hostname. When calling this function,
`size` must be set to the amount of storage available in `buffer`, including
the null terminator. If the hostname exceeds the storage available in
`buffer`, `UV_ENOBUFS` is returned, and `size` is set to the amount of
libuv/docs/src/signal.rst view on Meta::CPAN
Unix notes
----------
* SIGKILL and SIGSTOP are impossible to catch.
* Handling SIGBUS, SIGFPE, SIGILL or SIGSEGV via libuv results into undefined behavior.
* SIGABRT will not be caught by libuv if generated by `abort()`, e.g. through `assert()`.
* On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL pthreads library to
manage threads. Installing watchers for those signals will lead to unpredictable behavior
and is strongly discouraged. Future versions of libuv may simply reject them.
Data types
----------
.. c:type:: uv_signal_t
Signal handle type.
libuv/docs/src/threading.rst view on Meta::CPAN
.. _threading:
Threading and synchronization utilities
=======================================
libuv provides cross-platform implementations for multiple threading and
synchronization primitives. The API largely follows the pthreads API.
Data types
----------
.. c:type:: uv_thread_t
Thread data type.
.. c:type:: void (*uv_thread_cb)(void* arg)
Callback that is invoked to initialize thread execution. `arg` is the same
value that was passed to :c:func:`uv_thread_create`.
.. c:type:: uv_key_t
Thread-local key data type.
.. c:type:: uv_once_t
Once-only initializer data type.
.. c:type:: uv_mutex_t
libuv/docs/src/threading.rst view on Meta::CPAN
Barrier data type.
API
---
Threads
^^^^^^^
.. c:type:: uv_thread_options_t
Options for spawning a new thread (passed to :c:func:`uv_thread_create_ex`).
::
typedef struct uv_thread_options_s {
enum {
UV_THREAD_NO_FLAGS = 0x00,
UV_THREAD_HAS_STACK_SIZE = 0x01
} flags;
size_t stack_size;
} uv_thread_options_t;
More fields may be added to this struct at any time, so its exact
layout and size should not be relied upon.
.. versionadded:: 1.26.0
.. c:function:: int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg)
.. versionchanged:: 1.4.1 returns a UV_E* error code on failure
.. c:function:: int uv_thread_create_ex(uv_thread_t* tid, const uv_thread_options_t* params, uv_thread_cb entry, void* arg)
Like :c:func:`uv_thread_create`, but additionally specifies options for creating a new thread.
If `UV_THREAD_HAS_STACK_SIZE` is set, `stack_size` specifies a stack size for the new thread.
`0` indicates that the default value should be used, i.e. behaves as if the flag was not set.
Other values will be rounded up to the nearest page boundary.
.. versionadded:: 1.26.0
.. c:function:: uv_thread_t uv_thread_self(void)
.. c:function:: int uv_thread_join(uv_thread_t *tid)
.. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2)
Thread-local storage
^^^^^^^^^^^^^^^^^^^^
.. note::
The total thread-local storage size may be limited. That is, it may not be possible to
create many TLS keys.
.. c:function:: int uv_key_create(uv_key_t* key)
.. c:function:: void uv_key_delete(uv_key_t* key)
.. c:function:: void* uv_key_get(uv_key_t* key)
.. c:function:: void uv_key_set(uv_key_t* key, void* value)
Once-only initialization
^^^^^^^^^^^^^^^^^^^^^^^^
libuv/docs/src/threading.rst view on Meta::CPAN
.. c:function:: void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex)
.. c:function:: int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout)
Barriers
^^^^^^^^
Functions return 0 on success or an error code < 0 (unless the
return type is void, of course).
.. note::
:c:func:`uv_barrier_wait` returns a value > 0 to an arbitrarily chosen "serializer" thread
to facilitate cleanup, i.e.
::
if (uv_barrier_wait(&barrier) > 0)
uv_barrier_destroy(&barrier);
.. c:function:: int uv_barrier_init(uv_barrier_t* barrier, unsigned int count)
.. c:function:: void uv_barrier_destroy(uv_barrier_t* barrier)
.. c:function:: int uv_barrier_wait(uv_barrier_t* barrier)
libuv/docs/src/threadpool.rst view on Meta::CPAN
.. _threadpool:
Thread pool work scheduling
===========================
libuv provides a threadpool which can be used to run user code and get notified
in the loop thread. This thread pool is internally used to run all file system
operations, as well as getaddrinfo and getnameinfo requests.
Its default size is 4, but it can be changed at startup time by setting the
``UV_THREADPOOL_SIZE`` environment variable to any value (the absolute maximum
is 128).
The threadpool is global and shared across all event loops. When a particular
function makes use of the threadpool (i.e. when using :c:func:`uv_queue_work`)
libuv preallocates and initializes the maximum number of threads allowed by
``UV_THREADPOOL_SIZE``. This causes a relatively minor memory overhead
(~1MB for 128 threads) but increases the performance of threading at runtime.
.. note::
Note that even though a global thread pool which is shared across all events
loops is used, the functions are not thread safe.
Data types
----------
.. c:type:: uv_work_t
Work request type.
.. c:type:: void (*uv_work_cb)(uv_work_t* req)
Callback passed to :c:func:`uv_queue_work` which will be run on the thread
pool.
.. c:type:: void (*uv_after_work_cb)(uv_work_t* req, int status)
Callback passed to :c:func:`uv_queue_work` which will be called on the loop
thread after the work on the threadpool has been completed. If the work
was cancelled using :c:func:`uv_cancel` `status` will be ``UV_ECANCELED``.
Public members
^^^^^^^^^^^^^^
.. c:member:: uv_loop_t* uv_work_t.loop
Loop that started this request and where completion will be reported.
Readonly.
.. seealso:: The :c:type:`uv_req_t` members also apply.
API
---
.. c:function:: int uv_queue_work(uv_loop_t* loop, uv_work_t* req, uv_work_cb work_cb, uv_after_work_cb after_work_cb)
Initializes a work request which will run the given `work_cb` in a thread
from the threadpool. Once `work_cb` is completed, `after_work_cb` will be
called on the loop thread.
This request can be cancelled with :c:func:`uv_cancel`.
.. seealso:: The :c:type:`uv_req_t` API functions also apply.
libuv/docs/src/tty.rst view on Meta::CPAN
* 0 = stdin
* 1 = stdout
* 2 = stderr
On Unix this function will determine the path of the fd of the terminal
using :man:`ttyname_r(3)`, open it, and use it if the passed file descriptor
refers to a TTY. This lets libuv put the tty in non-blocking mode without
affecting other processes that share the tty.
This function is not thread safe on systems that don't support
ioctl TIOCGPTN or TIOCPTYGNAME, for instance OpenBSD and Solaris.
.. note::
If reopening the TTY fails, libuv falls back to blocking writes.
.. versionchanged:: 1.23.1: the `readable` parameter is now unused and ignored.
The correct value will now be auto-detected from the kernel.
.. versionchanged:: 1.9.0: the path of the TTY is determined by
:man:`ttyname_r(3)`. In earlier versions libuv opened