Fork watcher will not be called if fork() is invoked in prepare watcher callback.

Marc Lehmann schmorp at schmorp.de
Fri May 2 07:16:48 CEST 2014


On Thu, May 01, 2014 at 04:33:40PM +0800, 李晓岚 <LeeXiaolan+libev at gmail.com> wrote:
> Considering this scenario, loop_init called without EVFLAG_FORKCHECK,
> then register some fork and prepare watchers and start them. At a
> certain point, in prepare watcher callback fork() is called, and in
> child process ev_loop_fork() is also called honestly. Oops, the
> callbacks of fork watcher will never be fired.

Indeed, something has to give. I'll have a look into it, but the most
likely outcome is that this will simply be documented.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list