Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 1998 11:46:32 +0200 (SAT)
From:      Graham Wheeler <gram@cdsec.com>
To:        tlambert@primenet.com (Terry Lambert)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: The inetd realloc problem: an observation
Message-ID:  <199809290946.LAA00495@cdsec.com>
In-Reply-To: <199809282156.OAA07483@usr04.primenet.com> from "Terry Lambert" at Sep 28, 98 09:56:22 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > So far it seems to be working fine. My approach was not as sophisticated as
> > the one suggested by others (writing values into a pipe). I just changed 
> > each handler to set a volatile int variable, modified the main select() to
> > use a 60 second timeout, and before the select, did a:
> > 
> > 	while (any signal handler flag set)
> > 	{
> > 	    if (sigchld_flag) { sigchld_flag = 0; do_old_sigchld_handler(); }
> > 	    ...
> > 	}
> > 
> > It may be possible that this is vulnerable to race conditions, but thus
> > far it has been working fine.
> 
> If you don't have call restart, then you don't need the timeout
> (select will return -1 with an errno of EINTR).  If you do this,

The timeout is necessary in case a signal happens after exiting the above
loop but before the call to select. 

-- 
Dr Graham Wheeler                          E-mail: gram@cdsec.com
Citadel Data Security                      Phone:  +27(21)23-6065/6/7
Internet/Intranet Network Specialists      Mobile: +27(83)253-9864
Firewalls/Virtual Private Networks         Fax:    +27(21)24-3656
Data Security Products                     WWW:    http://www.cdsec.com/




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809290946.LAA00495>