From owner-freebsd-hackers Thu May 2 20:30:35 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA17979 for hackers-outgoing; Thu, 2 May 1996 20:30:35 -0700 (PDT) Received: from melb.werple.net.au (melb.werple.net.au [203.9.190.18]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id UAA17963 for ; Thu, 2 May 1996 20:30:30 -0700 (PDT) Received: from cimaxp1.UUCP (uucp@localhost) by melb.werple.net.au (8.7.5/8.7.3) with UUCP id MAA28269 for mira!freebsd.org!freebsd-hackers; Fri, 3 May 1996 12:50:35 +1000 (EST) Message-Id: <199605030250.MAA28269@melb.werple.net.au> Received: by cimaxp1.cimlogic.com.au; (5.65/1.1.8.2/10Sep95-0953AM) id AA23400; Fri, 3 May 1996 12:51:07 +1000 From: John Birrell Subject: Re: stdio problem To: CS.Berkeley.EDU!jmacd@melb.werple.net.au (Josh MacDonald) Date: Fri, 3 May 1996 12:51:06 +1000 (EST) Cc: atrad.adelaide.edu.au!msmith@melb.werple.net.au, uriah.heep.sax.de!joerg_wunsch@melb.werple.net.au, freebsd.org!freebsd-hackers@melb.werple.net.au In-Reply-To: <199605030049.RAA18275@paris.CS.Berkeley.EDU> from "Josh MacDonald" at May 2, 96 05:49:57 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > > Why couldn't you all just answer my questions instead of telling me > > > it is wrong. Obviously, I already know that > > > it doesn't work on FreeBSD or NetBSD, and that it works on every other > > > operating system I've tried it on. We routinely close stdin and re-assign the file descriptor under *both* FreeBSD and NetBSD (i386 & alpha). We don't use freopen, so I can't comment on any bugs in that code. We close(fileno(stdin)) and then fcntl(another_fd,F_DUPFD,fileno(stdin)) and this works fine. We use the same code on OSF/1, HPUX, SCO, LynxOS, Motorola R3V5,6. -- John Birrell CIMlogic Pty Ltd jb@cimlogic.com.au 119 Cecil Street Ph +61 3 9690 6900 South Melbourne Vic 3205 Fax +61 3 9690 6650 Australia Mob +61 18 353 137