Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Aug 2004 11:35:39 +0200
From:      Tijl Coosemans <tijl@ulyssis.org>
To:        freebsd-questions@freebsd.org
Subject:   4-stable termios diff behaviour lc/lc_r
Message-ID:  <20040829113539.58e09498.tijl@ulyssis.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--Multipart=_Sun__29_Aug_2004_11_35_39_+0200_jbEuP2nY.lCGEp2b
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

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 4 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?

-- 
Tijl Coosemans

--Multipart=_Sun__29_Aug_2004_11_35_39_+0200_jbEuP2nY.lCGEp2b
Content-Type: text/plain;
 name="vtime.c"
Content-Disposition: attachment;
 filename="vtime.c"
Content-Transfer-Encoding: base64

I2luY2x1ZGUgPGZjbnRsLmg+CiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8c3lzL3R5cGVz
Lmg+CiNpbmNsdWRlIDx0ZXJtaW9zLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KCmludCBtYWluKHZv
aWQpIHsKCWludCBmZCwgbGVuOwoJc3RydWN0IHRlcm1pb3MgdGVybXNldDsKCXVpbnQ4X3QgZGF0
YVs0XTsKCglmZCA9IG9wZW4oIi9kZXYvY3VhYTAiLCBPX1JET05MWSk7CgoJdGNnZXRhdHRyKGZk
LCAmdGVybXNldCk7Ci8vCWNmbWFrZXJhdygmdGVybXNldCk7Ci8vCWNmc2V0c3BlZWQoJnRlcm1z
ZXQsIEI5NjAwKTsKCXRlcm1zZXQuY19jY1tWTUlOXSA9IDA7Cgl0ZXJtc2V0LmNfY2NbVlRJTUVd
ID0gMjA7Cgl0Y3NldGF0dHIoZmQsIFRDU0FOT1csICZ0ZXJtc2V0KTsKCglsZW4gPSByZWFkKGZk
LCAodm9pZCAqKSBkYXRhLCA0KTsKCXByaW50ZigiJWRcbiIsIGxlbik7CgoJY2xvc2UoZmQpOwoJ
cmV0dXJuIDA7Cn0=

--Multipart=_Sun__29_Aug_2004_11_35_39_+0200_jbEuP2nY.lCGEp2b--



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