Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2002 20:55:32 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Archie Cobbs <archie@dellroad.org>
Cc:        Bakul Shah <bakul@bitblocks.com>, <freebsd-arch@FreeBSD.ORG>
Subject:   Re: /dev/stdout behavior
Message-ID:  <20020911204937.G1092-100000@gamplex.bde.org>
In-Reply-To: <200209102135.g8ALZXm34757@arch20m.dellroad.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020911204937.G1092-100000>