> > No, that's not right (and would be _really_ happy to stand
> > corrected). select and signals for interruption are not
> > compatible. You always have a race condition between unblocking the
> > signal and actually getting into select. AFAIK POSIX defines the
> > pselect call for this problem which also introduces a signal mask
> > argument. Without this, signals are useless to interrupt select.
>
> I hit just such a race in xdm with xdmcp enabled. Because of the
> particular way I was using it (forcibly logging students in labs off by
> signalling xdm) I was caught by this race moderately often.
>
> What I did was make the "struct timeval" which was passed to select a
> global, and had the signal handler set it to 0,0. If the signal came
> in before the select, the select would exit immediately due to a
> timeout.
What a hack ;-)
Thanks for the idea
Christoph
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/