From owner-freebsd-hackers Tue Sep 29 02:40:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA19003 for freebsd-hackers-outgoing; Tue, 29 Sep 1998 02:40:55 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from citadel.cdsec.com (citadel.cdsec.com [192.96.22.18]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA18989 for ; Tue, 29 Sep 1998 02:40:39 -0700 (PDT) (envelope-from gram@cdsec.com) Received: (from nobody@localhost) by citadel.cdsec.com (8.8.8/8.6.9) id LAA05197; Tue, 29 Sep 1998 11:47:57 +0200 (SAST) Received: by citadel via recvmail id 5195; Tue Sep 29 11:47:51 1998 From: Graham Wheeler Message-Id: <199809290946.LAA00495@cdsec.com> Subject: Re: The inetd realloc problem: an observation To: tlambert@primenet.com (Terry Lambert) Date: Tue, 29 Sep 1998 11:46:32 +0200 (SAT) Cc: hackers@FreeBSD.ORG In-Reply-To: <199809282156.OAA07483@usr04.primenet.com> from "Terry Lambert" at Sep 28, 98 09:56:22 pm X-Mailer: ELM [version 2.4 PL25-h4.1] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > 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