Date: Tue, 10 Sep 2002 12:21:07 -0700 (PDT) From: Archie Cobbs <archie@dellroad.org> To: Nate Lawson <nate@root.org> Cc: freebsd-arch@FreeBSD.ORG Subject: Re: /dev/stdout behavior Message-ID: <200209101921.g8AJL7J34317@arch20m.dellroad.org> In-Reply-To: <Pine.BSF.4.21.0209101051230.18643-100000@root.org> "from Nate Lawson at Sep 10, 2002 10:52:58 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Nate Lawson writes: > > 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 */ Sorry.. please replace '0' with '1' everywhere. The original question remains. Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com 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?200209101921.g8AJL7J34317>