Date: Wed, 11 Sep 2002 10:05:24 -0700 From: Bakul Shah <bakul@bitblocks.com> To: Terry Lambert <tlambert2@mindspring.com> Cc: Bruce Evans <bde@zeta.org.au>, Archie Cobbs <archie@dellroad.org>, freebsd-arch@FreeBSD.ORG Subject: Re: /dev/stdout behavior Message-ID: <200209111705.NAA17300@devonshire.cnchost.com> In-Reply-To: Your message of "Wed, 11 Sep 2002 06:53:00 PDT." <3D7F4ABC.6C84FC79@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > /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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209111705.NAA17300>