4-stable termios diff behaviour lc/lc_r

Don Lewis truckman at FreeBSD.org
Mon Aug 30 12:38:51 PDT 2004


On 30 Aug, Tijl Coosemans wrote:

> I've done some more testing. It appears that when linked with lc_r,
> VTIME is completely ignored.
> 
> As explained in termios(4), when VMIN>0, the read call will wait
> indefinitely for the first byte and then use VTIME as an interbyte
> timer. When using lc_r however, it'll return immediately after the
> first couple bytes read, even if that's less than VMIN.
> 
> The case where VTIME==0 works as it should both with lc and lc_r.

This is not suprising.  The way libc_r handles I/O is that it puts all
the descriptors in non-blocking mode and uses poll() to figure out which
threads to run.  To work properly, libc_r would have to emulate VMIN
internally.

> I dont have access to a box with -current, so I can't say if the same
> applies to it.

I would expect the same behaviour with libc_r on -CURRENT, but the other
thread libraries should work properly.

> I hope somebody understands this better or could at least give me a
> few pointers as to where to look in the source code.
> 
> Thanks, tijl



More information about the freebsd-stable mailing list