Re: Can EINTR be handled the way BSD handles it? -- a plea from a user-land programmer...

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Fri Nov 03 2000 - 15:20:23 EST


On Fri, 3 Nov 2000 george@moberg.com wrote:

> Considering that the threading library for Linux uses signals to make it
> work, would it be possible to change the Linux kernel to operate the way
> BSD does--instead of returning EINTR, just restart the interrupted
> primitive?
>
It's just how the default for signal() is set up by the 'C' runtime
library. Instead of using signal, use sigaction(), set the SA_RESTART
flag and you have BSD action.

It is also possible to compile existing applications using

-D_BSD_SIGNALS (this is from memory, it might not be exactly correct).

New applications should not use signal(), then should use sigaction()
which gives POSIX-defined fine control over the signal handler.

Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Nov 07 2000 - 21:00:14 EST