Re: select implementation not POSIX compliant?

From: Manfred Spraul
Date: Wed Aug 11 2004 - 15:47:32 EST


Nick wrote:

Furthermore, a call to close and then select in the same thread
blocks while the other thread is still in select, which has a very large
surprise factor, since the code would work were it not for the other
select.



Could you post the test case for this behavior: I assume your test app is buggy: a select call that is executed after close returned must return EBADF, everything else would be a bug.

Regarding your main point: The return result from select/poll is undefined in Linux if you close a descriptor while another thread polls or selects it.
This is consistent with the behavior of other Unices - for example HP UX kills the process if you replace a descriptor that is being polled with dup2.

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