Re: Question about Linux signal handling

Albert Cahalan
2003-02-23T22:58:28Z

On Sun, 2003-02-23 at 18:43, Alan Cox wrote:
> On Sun, 2003-02-23 at 22:29, Albert Cahalan wrote:

>> Yes. This is the behavior of all SysV UNIX systems
>> and Linux kernels. Unfortunately, BSD got it wrong.
>
> Firstly BSD didn't get it wrong, things merely diverged
> historically after V7 unix.

BSD is wrong for not choosing a different name
for the new system call and leaving the old one.
There could have been a signal2() with the new
behavior. X/Open even did this, with bsd_signal()
as the name. Breaking compatibility is bad.

>> Worse, the glibc developers saw fit to ignore both
>> UNIX history and Linus. They implemented BSD behavior
>> by making signal() use the sigaction system call
>
> Also wrong. If you read the gcc documentation you can
> select favouring BSD or SYS5 behaviour at compile time
>
> glibc has the best of both worlds

Non-default behavior is nearly irrelevant. The default
should have matched traditional UNIX and Linux behavior.

The best of both worlds certainly means traditional
signal() and a bsd_signal(), with a non-default option
to choose the BSD signal() behavior.