From owner-freebsd-stable@FreeBSD.ORG Wed Sep 1 22:12:52 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A68E716A4CE; Wed, 1 Sep 2004 22:12:52 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AE5D43D1D; Wed, 1 Sep 2004 22:12:52 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) i81MCoFG008278; Wed, 1 Sep 2004 18:12:50 -0400 (EDT) Date: Wed, 1 Sep 2004 18:12:49 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Julian Elischer In-Reply-To: <4134C51A.8010207@vicor.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: threads@freebsd.org cc: freebsd-stable@freebsd.org Subject: Re: 4-stable termios diff behaviour lc/lc_r X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2004 22:12:52 -0000 On Tue, 31 Aug 2004, Julian Elischer wrote: > > this should have been sent to -threads.. > -------------------------------------------- > >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. Yes, and it will always be completely ignored. If you want to use libc_r on 4.x, you'll have to work around it (use select() or poll() perhaps). It is not a problem in 5.x which will be the next -stable. -- Dan Eischen