Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Apr 2001 23:54:25 -0400 (EDT)
From:      "Albert D. Cahalan" <acahalan@cs.uml.edu>
To:        freebsd-questions@freebsd.org
Cc:        a.genkin@utoronto.ca, lucas@slb.to
Subject:   Re: [OT] Reinstalling signal handler inside signal handler
Message-ID:  <200104060354.f363sPn220253@saturn.cs.uml.edu>

next in thread | raw e-mail | index | archive | help

Lucas Bergman writes:
> [Arcady Genkin]

>>> Signals on "traditional" systems (V7, System V) were reset to
>>> their default behavior after they were raised, so the signal
>>> handler had to reinstall itself if it was to persist.  BSD changed
>>> that; you have to deliberately reset a signal's behavior (excuse
>>> the split infinitive).  Linux actually follows the old semantics,
>>> but you can include <bsd/signal.h> instead of <signal.h> (or call
>>> __bsd_signal() instead of signal()) to get the BSD semantics.
>>
>> Lucas, thanks for your answer.  For the record, it seems like Linux
>> does use the *BSD* sematics that you describe above.
>
> I'll be damned.  The following code demonstrates that you're right:

The Linux kernel uses genuine UNIX semantics as it should.
The C library developers used sigaction() to implement BSD
semantics, breaking everything that was written for the
traditional UNIX API.

(no, I DON'T want to catch that signal again, I only asked you once!)



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104060354.f363sPn220253>