Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 2004 12:38:42 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        tijl@ulyssis.org
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: 4-stable termios diff behaviour lc/lc_r
Message-ID:  <200408301938.i7UJcg4j018717@gw.catspoiler.org>
In-Reply-To: <20040830204553.0046ca41.tijl@ulyssis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408301938.i7UJcg4j018717>