Wanting a pre-db4 bogofilter

Matthias Andree matthias.andree at gmx.de
Sat Feb 26 02:16:00 CET 2005


Jef Poskanzer <jef at acme.com> writes:

> I took a look at what I do in my various programs.  I like to catch
> SIGINT and SIGTERM, and sometimes SIGHUP.  I don't bother with SIGKILL
> (actually the man page implies you can't catch it).  I call sigset() if
> it's available and signal() otherwise.

sigset() and signal() are deprecated, new code is supposed to use
sigaction(), which has been around for a decade or so. There is no
excuse for an OS that does not support it.

> You have to be a little careful about what kinds of things you do in
> the handler routine - safest is to just set a flag saying 'a signal
> happened', and deal with it somewhere back in the main thread.

Indeed. Signal handlers may only call upon reentrant functions - this is
stricter than thread-safe - and, for instance, stdio is taboo.

-- 
Matthias Andree
_______________________________________________
Bogofilter mailing list
Bogofilter at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter



More information about the Bogofilter mailing list