On Tue, 21 Mar 2006, Jan Engelhardt wrote:
> Hello list,
>
>
> I have found out that when linking a userspace application with -lpthread,
> then for some reason, a device driver's read() routine suddenly has
> IO_NDELAY set in flags. Bug?
No, what you are seing is the consequence of having a userland thread
implementation. All IO will be done in non-blocking mode, to not
allow a single thread to block all threads. The pthread lib manages
things to present a blocking call to the thread doing the IO.
BTW, the recommeneded way to link a threaded app is by specifying
-pthtread on the link command line, not by just linking with
-lpthread. See pthread(3).
-Otto
>
> I am using OpenBSD 3.8.
> A testcase is at http://jengelh.hopto.org/f/openbsd-pthread-strange.tgz
>
>
> Jan Engelhardt
> --