Date: Mon, 14 Dec 1998 06:53:48 +0100 (CET) From: List User <listuser@netspace.net.au> To: freebsd-current@FreeBSD.org Message-ID: <199812140553.GAA06551@doorway.home.lan>
next in thread | raw e-mail | index | archive | help
Newsgroups: freebsd.current Path: root From: Terry Lambert <tlambert@primenet.com> Subject: Re: inetd: realloc/free bug Content-Type: text/plain; charset=US-ASCII Received: (from tlambert@localhost) by usr09.primenet.com (8.8.5/8.8.5) id PAA10383; Sun, 13 Dec 1998 15:44:29 -0700 (MST) To: dillon (Matthew Dillon) Sender: owner-freebsd-current@FreeBSD.ORG Content-Transfer-Encoding: 7bit Organization: Private News Host Precedence: bulk Message-ID: <199812132244.PAA10383@usr09.primenet.com> X-Mailer: ELM [version 2.4 PL25] Delivered-To: vmailer-current@freebsd.org X-Uidl: 5544d48168888e07a011e920f4adf1ba X-Loop: FreeBSD.ORG Mime-Version: 1.0 In-Reply-To: <199812110659.WAA35073@apollo.backplane.com> from "Matthew Dillon" at Dec 10, 98 10:59:07 pm Cc: archie, jwd, freebsd-current Date: Sun, 13 Dec 1998 22:44:29 GMT > :> If you put a time limit on select(), it doesn't matter if there is a > :> race condition there. How does select() cause a signal to be missed ? > : > :Well, sure.. :-) but then you don't service signals in real time > :and spend extra cycles timing out all the time. > > You do serve signals in real time... the signals are *unmasked* during > the select() :-) ... the race condition is that the unmasked signal may > cause the descriptor set to be changed just prior to the select() call, > causing select() to wait forever. The timeout on the select() handles > the race condition without effecting the realtime delivery of signals. You should just use siginterrupt(3) to make sure select restarts, and be done with it. If you need to interrupt the select after setting system call restart behaviour, then use a longjmp from the signal handler after setting a volatile flag so that the flag can be tested in the "else" case of the setjmp() call. If the call is restarted, you don't have to worry about the timer, it will do the right thing, and you won't get an EINTR that you con't know how to handle the masks around. If you don't like siginterrupt(3), and want to use the non-Berkeley signal mechanisms for setting call restart behaviour, then be my guest and write 30 or 40 lines of POSIX expecting code instead. The siginterrupt(2) system call first appeared in BSD 4.1c; the current code uses POSIX sigaction(2); someone might want to correct the siginterrupt(3) man page... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812140553.GAA06551>