From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 04:38:26 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 440A137B401 for ; Wed, 9 Apr 2003 04:38:26 -0700 (PDT) Received: from comp.chem.msu.su (comp-ext.chem.msu.su [158.250.32.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47EB643FAF for ; Wed, 9 Apr 2003 04:38:21 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.12.3p2/8.12.3) with ESMTP id h39BashE064232; Wed, 9 Apr 2003 15:38:15 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.12.3p2/8.12.3/Submit) id h39BasTx064231; Wed, 9 Apr 2003 15:36:54 +0400 (MSD) (envelope-from yar) Date: Wed, 9 Apr 2003 15:36:53 +0400 From: Yar Tikhiy To: "Andrey A. Chernov" Message-ID: <20030409113653.GA63770@comp.chem.msu.su> References: <20030408164614.GA7236@comp.chem.msu.su> <20030408181707.GA42723@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030408181707.GA42723@nagual.pp.ru> User-Agent: Mutt/1.5.3i cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 11:38:26 -0000 On Tue, Apr 08, 2003 at 10:17:08PM +0400, Andrey A. Chernov wrote: > On Tue, Apr 08, 2003 at 20:46:14 +0400, Yar Tikhiy wrote: > > While not in disagreement with POSIX[1], such a behaviour has at > > least one unwelcome consequence: If a program has been compiled > > with ``-pthread'', the TIME counter won't work on terminal descriptors > > that are in blocking mode from the program's point of view -- read(2) > > will instantly return 0 on them. That is because the following > > scenario will happen: > ... > > > Shouldn't both TIME and MIN cases be uniform in returning -1/EAGAIN > > on non-blocking descriptors? > > It means that libc_r MIN/TIME handling should be fixed to conform POSIX > and not general MIN/TIME handling way. Not exactly, I'm afraid. If the system returns 0 from read(), libc_r has nothing else to do but to pass this 0 to the application because it may be the EOF sign. Of course, the issue is more complex then I outlined, as Bruce Evans has pointed out. However, why to treat TIME differently from MIN in the system? -- Yar