Disabling the SIGCHLD handler

Marc Lehmann schmorp at schmorp.de
Thu Jan 10 04:57:09 CET 2008


On Wed, Jan 09, 2008 at 08:36:32PM -0700, Tony Arcieri <tony at clickcaster.com> wrote:
> But, rather than using ev_child, we have our own (legacy) SIGCHLD handler
> which does all sorts of fantastic legacy stuff and doesn't exactly map onto
> ev_child very well...

Or maybe it maps fine, but you can't change it? :)

> It'd be super handy if there were a way to use libev's default loop to
> receive signals, sans the built-in SIGCHLD handler.

I do not think so: the default loop is for use by all components in a
program. If you need a loop without signal handling, just create one.

You can also overwrite the signal handler in that "legacy" app with the
other sigchld handler.

The problem with disabling is, what should libev do when asked to provide a
child watcher? abort?

> Would you consider adding an option to ev_default_loop() to allow for
> this?

I am, if there is a better reason for it. I think the existing options
already cover this nicely. If its demonstrably problematic, then I will
add such an option, but I think an alternative loop is the corretc way to
approach the problem (thats what they are there for).

Note also that its quite valid to install your own handler and at the same
time use ev_feed_signal_event to daisy-chain thre sigchld into libev, thus
breaking nothing.

Or you can install your legacy sigchld handler as normal SIGCHLD watcher
- multiple watchers per signal are allowed (ok, wouldn't make much sense,
just override it :)

> And by the way, the hypothetical application I'm describing here is Rubinius
> (http://rubini.us/)

Very hypothetical application :->

(doh, the page overrides the font with something totally unreadable, I
can't read it :)

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



More information about the libev mailing list