Re: signal handler information



"Clancy, Shane W." <SCLANCY northropgrumman com> writes: 
> can someone tell me where i should be looking for examples or tutorials on
> how to do this?
> 

Two suggestions: 

 - in GLib 2, the g_spawn_async_* functions will make your life 
   a whole lot easier
 - good books are "Beginning Linux Programming" (Wrox Press) and 
   "Advanced Programming in UNIX Environment" by Stevens

The only hard part here is your "child died" notification, I think the
simplest way is to use a pipe from g_spawn_async_ and then
g_io_add_watch() on the parent end of the pipe to detect a G_IO_HUP
condition which will come when the child dies. Another option is to
use UNIX signals with SIGCHLD which means you need to use the
G_SPAWN_DO_NOT_REAP_CHILD flag IIRC.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]