[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: The inetd realloc problem: an observation
From:       Graham Wheeler <gram () cdsec ! com>
Date:       1998-09-29 9:46:32
[Download RAW message or body]

> 
> > 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic