From owner-freebsd-arch Tue Sep 10 10:17:48 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 BB0D737B400 for ; Tue, 10 Sep 2002 10:17:46 -0700 (PDT) Received: from wellington.cnchost.com (wellington.concentric.net [207.155.252.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21A2B43E42 for ; Tue, 10 Sep 2002 10:17:46 -0700 (PDT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by wellington.cnchost.com id NAA07504; Tue, 10 Sep 2002 13:17:45 -0400 (EDT) [ConcentricHost SMTP Relay 1.14] Message-ID: <200209101717.NAA07504@wellington.cnchost.com> To: Archie Cobbs Cc: freebsd-arch@FreeBSD.ORG Subject: Re: /dev/stdout behavior In-reply-to: Your message of "Tue, 10 Sep 2002 09:56:19 PDT." <200209101656.g8AGuJ433605@arch20m.dellroad.org> Date: Tue, 10 Sep 2002 10:17:44 -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 > 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. Careful reading of man stdout will reveal that opening /dev/stdout is equivalent to dup()ing fd 1, not fd 0. FreeBSD has a bug. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message