From owner-freebsd-arch Wed Sep 11 10: 5:30 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 175F937B400 for ; Wed, 11 Sep 2002 10:05:29 -0700 (PDT) Received: from devonshire.cnchost.com (devonshire.concentric.net [207.155.248.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF57E43E4A for ; Wed, 11 Sep 2002 10:05:28 -0700 (PDT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by devonshire.cnchost.com id NAA17300; Wed, 11 Sep 2002 13:05:25 -0400 (EDT) [ConcentricHost SMTP Relay 1.14] Message-ID: <200209111705.NAA17300@devonshire.cnchost.com> To: Terry Lambert Cc: Bruce Evans , Archie Cobbs , freebsd-arch@FreeBSD.ORG Subject: Re: /dev/stdout behavior In-reply-to: Your message of "Wed, 11 Sep 2002 06:53:00 PDT." <3D7F4ABC.6C84FC79@mindspring.com> Date: Wed, 11 Sep 2002 10:05:24 -0700 From: Bakul Shah 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 > > /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. > > It's not standardized at all. The difference seems to be that > FreeBSD takes it as an alias for a descriptor, whereas Linux takes > it as an alias for the FS object to which the descriptor refers. It is not standardized but the FreeBSD interpretation is sensible. All opens of /dev/stdout, /dev/fd/1 and the actual stdout must point to the same struct file entry in the systemwide file table. I think the difference seems to be what flags are per process versus system wide (for a given file descriptor) and what per process flags are copied versus initialized. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message