Re: 4-stable termios diff behaviour lc/lc_r
From: Tijl Coosemans (tijl_at_ulyssis.org)
Date: 08/30/04
- Previous message: horio shoichi: "Re: mesg Broke on Stable between 8/21 and 8/28"
- Next in thread: Don Lewis: "Re: 4-stable termios diff behaviour lc/lc_r"
- Reply: Don Lewis: "Re: 4-stable termios diff behaviour lc/lc_r"
- Maybe reply: Julian Elischer: "Re: 4-stable termios diff behaviour lc/lc_r"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 30 Aug 2004 20:45:53 +0200 To: freebsd-stable@freebsd.org
Original message on -questions, but this list seems more appropriate.
More below.
On Sun, 29 Aug 2004 11:35:39 +0200, Tijl Coosemans wrote:
> Hi list,
>
> I think I've found a possible bug in 4-stable, though I'm not that
> kind of an expert so I'll leave that decision up to you.
>
> Attached is a little test program that opens /dev/cuaa0 and tries to
> read a couple bytes.
>
> When compiled using "gcc vtime.c -o vtime" there's no problem. For
> example, when you run vtime without anything attached to cuaa0,
> it'll wait about 2 seconds and timeout, since VMIN=0 and VTIME=20.
>
> When compiled using "gcc -pthread vtime.c -o vtime" however, the
> read function returns immediately, which as far as I can understand,
> is not what it's supposed to do.
>
> Does anyone know if this intended or not, or how I can get the right
> behaviour in a threaded program?
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.
I dont have access to a box with -current, so I can't say if the same
applies to it.
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
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
- text/plain attachment: vtime.c
- Previous message: horio shoichi: "Re: mesg Broke on Stable between 8/21 and 8/28"
- Next in thread: Don Lewis: "Re: 4-stable termios diff behaviour lc/lc_r"
- Reply: Don Lewis: "Re: 4-stable termios diff behaviour lc/lc_r"
- Maybe reply: Julian Elischer: "Re: 4-stable termios diff behaviour lc/lc_r"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]