libuv/include
Jason Madden fd7ce57f2b unix: make loops and watchers usable after fork()
Added the uv_loop_fork() API that must be called in a child process to
continue using an existing loop. Internally this calls a uv__io_fork
function for each supported platform, similar to the way
uv__platform_loop_init works.

After this call, existing and new IO, async and signal watchers will
contiue working as before on all platforms, as will the
threadpool (although any threads it was using are of course gone).

On Linux and BSDs that use kqueue, existing and new fsevent watchers
will also continue to work as expected. On OS X, though, directory
fsevents will not be able to use the optimized CoreFoundation path if
they had already been used in the parent process, instead falling back
to the kqueue path used on other BSDs.

Existing fsevent watchers will not function on AIX or SunOS. This
could be relatively easily fixed by someone with AIX knowledge in the
future, but SunOS will require some additional work to keep track if
the watchers.

A new test file, test/test-fork.c, was added to contain fork-related
tests to verify functionality in the child process.

PR-URL: https://github.com/libuv/libuv/pull/846
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-03-21 12:23:44 +01:00
..
android-ifaddrs.h android: add support of ifaddrs in android 2014-03-16 23:16:25 +01:00
pthread-barrier.h zos: make platform functional 2017-01-18 08:42:59 -06:00
stdint-msvc2008.h build: switch to autotools 2013-07-02 01:21:16 +02:00
tree.h build: switch to autotools 2013-07-02 01:21:16 +02:00
uv-aix.h aix: improve AIX compatibility 2014-07-22 22:57:24 +02:00
uv-bsd.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-darwin.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-errno.h build: GNU/kFreeBSD support 2016-08-20 08:55:30 +02:00
uv-linux.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-os390.h zos: make platform functional 2017-01-18 08:42:59 -06:00
uv-sunos.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-threadpool.h unix, windows: use the same threadpool implementation 2014-06-27 14:27:04 +02:00
uv-unix.h unix: simplify async watcher dispatch logic 2017-03-15 10:03:10 +01:00
uv-version.h Now working on version 1.11.1 2017-01-31 19:50:51 -05:00
uv-win.h win: added fcntl.h to uv-win.h 2017-01-14 21:38:44 +01:00
uv.h unix: make loops and watchers usable after fork() 2017-03-21 12:23:44 +01:00