Date: Fri, 11 Dec 1998 16:20:06 -0800 From: Peter Edwards <peter.edwards@isocor.ie> To: Archie Cobbs <archie@whistle.com> Cc: freebsd-current@FreeBSD.ORG Subject: Re: inetd: realloc/free bug Message-ID: <3671B6B6.792BA595@isocor.ie> References: <199812111957.LAA27876@bubba.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Archie Cobbs wrote: > > > sigprocmask(SIG_UNBLOCK ..) /* unblock signals */ > > r = select(...) /* wait for event */ > > sigprocmask(SIG_BLOCK ..) /* block signals */ > > > > if (signalFlag || r > 0) { > > ... /* handle event(s) */ > > } > > OK, if you call the signal "event" handler from within the actual > signal handler because of a signal received bewtween lines 1 and 2, > that's OK because you know you're not in a recursive malloc() situation. > So I guess that would work. I think someone else mentioned the problem where the select() timeout can delay processing if the signal arrives inside the race window. That's what I was suggesting getting around with the setjmp/longjmp from signal handler. I know its pretty horrendous, but I just got side-tracked into thinking about what happens normally between the time you return from a signal handler and the synchronous program flow resumes. Can anyone synopsize? Cheers, Peter. 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?3671B6B6.792BA595>