02-18-04 12:34 PM
Ah! Well, traditionally system calls are either "slow" or "fast" -
"slow" ones are those that can block for ever. (I am quoting from
"Advanced programming in the UNIX Environment" by W Richard Stevens).
"slow" calls are interruptible, "fast" ones are not.
Signals can only be accepted by processes while they are in functions
that are "interruptible".
And even otherwise interruptible calls may restart after a signal is
accepted rather than return -1 with EINTR set, depending on the
disposition of the SA_RESTART flag for that signal.
Robert
Jens.Toerring@physik.fu-berlin.de wrote:
> Robert Harris <robertdotfdotharris@blueyonder.co.uk> wrote:
>
>
>
> Why shouldn't a signal arrive when you call open(), being it for a
> normal file or a device file, so why do you think it's uninterrupt-
> ible? Since signals happen asynchronously I can't see what should
> protect an open() of just a normal file, especially without knowing
> where the file resides.
>
> In place of the OP I would simply again call open() until it succeeds
> (or returns with some other error), of course unless receipt of the
> signal has some special meaning that would make continuing with
> opening the file useless.
> Regards, Jens
[ Post a follow-up to this message ]
|