From owner-freebsd-arch Wed Sep 11 3:47:55 2002 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 5CD1237B400 for ; Wed, 11 Sep 2002 03:47:53 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19C8C43E4A for ; Wed, 11 Sep 2002 03:47:52 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA25572; Wed, 11 Sep 2002 20:47:44 +1000 Date: Wed, 11 Sep 2002 20:55:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Archie Cobbs Cc: Bakul Shah , Subject: Re: /dev/stdout behavior In-Reply-To: <200209102135.g8ALZXm34757@arch20m.dellroad.org> Message-ID: <20020911204937.G1092-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 10 Sep 2002, Archie Cobbs wrote: > Bakul Shah writes: > > You need to fix your test program similarly and run it under > > Linux to see if the two OSes behave differently. > > They do behave differently, even after adjusting '0' to '1': > > $ uname -a > Linux foobar.packetdesign.com 2.4.9 #19 SMP Mon Oct 29 11:55:31 PST 2001 i686 unknown > $ ./flags > O_NONBLOCK is not set This is a bug in Linux IMO. /dev/stdout should be as much like the real stdout as possible. E.g., it should share the file offset. This requires its descriptor to be a dup of stdout's descriptor for seekable files, and it would be surprising if non-seekable files like ttys were different. Sharing of O_NONBLOCK goes with sharing of the file (via diferent descriptors). Some device drivers have broken support for O_NONBLOCK (they do extra work to make it per-device), but tty devies get this right. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message