Re: [PATCH] Fix poll bug

From: kuznet@ms2.inr.ac.ru
Date: Thu Dec 14 2000 - 14:17:15 EST


Hello!

> I believe I've found an inconsistency between the behaviour of poll(2)
> and select(2); select() is restartable in the face of signals
> (sys_select() returns ERESTARTNOHAND if a signal is pending), whilst
> poll() is not (sys_poll() returns EINTR).

poll() cannot be restarted.

select() can, because state of timer is remembered.

> breaking code (or at least breaking code that expects BSD signal
> behaviour as the default,

BSD behaviour is never to restart select() (because BSD does
not update timer, it is the only possible behaviour there, otherwise
select can never terminate). Its restart in some rare cases
(when signal happens to be ignored) is small optimization,
specific only to Linux.

> which I believe is also the POSIX

Seems, POSIX behaviour is not to restart any syscall.

Alexey
-
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 : Fri Dec 15 2000 - 21:00:30 EST