From owner-freebsd-arch Tue Sep 10 10:53: 4 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 7E09937B400 for ; Tue, 10 Sep 2002 10:53:02 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id E5B9743E6A for ; Tue, 10 Sep 2002 10:52:57 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 18675 invoked by uid 1000); 10 Sep 2002 17:52:58 -0000 Date: Tue, 10 Sep 2002 10:52:58 -0700 (PDT) From: Nate Lawson To: Archie Cobbs Cc: freebsd-arch@freebsd.org Subject: Re: /dev/stdout behavior In-Reply-To: <200209101656.g8AGuJ433605@arch20m.dellroad.org> Message-ID: 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: > Is there an 'official' spec about how /dev/stdout is supposed to behave? > > For example, if you use fcntl() to set flags on fd 0, and then open > /dev/stdout, the new file descriptor you get back will have those > same flags set. Run the program below to see an example. This is > in agreement with the man page, which states that opening /dev/stdout > is equivalent to dup(2)'ing fd 0. > grep FILENO /usr/include/unistd.h #define STDIN_FILENO 0 /* standard input file descriptor */ #define STDOUT_FILENO 1 /* standard output file descriptor */ #define STDERR_FILENO 2 /* standard error file descriptor */ -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message