Linux signals and GLIB g_io_channel usage
- From: James Scott Jr <skoona verizon net>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Linux signals and GLIB g_io_channel usage
- Date: Mon, 23 Oct 2006 13:26:40 -0400
Folks,
I am about to write the socket module of a program that follows the gnu
standard structure for a daemon. I am using glib wherever possible and
have a question concerning the use of linux signals. Basically, I have
blocked all signals on all threads according to the standard daemon
model and use a single thread with a sigwait() to process the ones I'm
interested in; like SIGHUP to reload the config file.
Question: Will having all signals blocked interfere with the normal
operation of glib, in such a way that that I need to rethink how to
handle signals? I plan to use g_io_channel...() and g_io_add_watch() to
handle asynchronous reads from sockets.
This is what I mean by "signals blocked".
/* block all signals */
sigfillset (&signal_set);
pthread_sigmask (SIG_BLOCK, &signal_set, NULL);
if (i_debug != 88) {
/* Fork off the parent process */
if ( (daemon (0, 0) ) != 0) {
g_warning ("Fork() Failure -- shutdown");
exit (EXIT_FAILURE);
}
/* Change the file mode mask */
umask (0);
}
Thanks in advance.
James,
________________________________________________________________________
Registered Linux User #270764
FC5 on Dual AMD 2400+ MPs
________________________________________________________________________
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]