From owner-freebsd-hackers Thu May 2 16:34:24 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA05341 for hackers-outgoing; Thu, 2 May 1996 16:34:24 -0700 (PDT) Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA05324 for ; Thu, 2 May 1996 16:34:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by Root.COM (8.7.5/8.6.5) with SMTP id QAA00955; Thu, 2 May 1996 16:32:31 -0700 (PDT) Message-Id: <199605022332.QAA00955@Root.COM> X-Authentication-Warning: implode.Root.COM: Host localhost [127.0.0.1] didn't use HELO protocol To: Josh MacDonald cc: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch), freebsd-hackers@freebsd.org Subject: Re: stdio problem In-reply-to: Your message of "Thu, 02 May 1996 15:20:21 PDT." <199605022220.PAA17967@paris.CS.Berkeley.EDU> From: David Greenman Reply-To: davidg@Root.COM Date: Thu, 02 May 1996 16:32:31 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >The comments in stdio/freopen.c say this should work. It works everywhere >else. > >Your answers are not very helpful. > >Why couldn't you all just answer my questions instead of telling me >it is wrong. Because we're trying to determine if the behavior should be considered "undefined" (in which case being different from some other OS isn't a bug), or if there truely is a bug somewhere. In your case, the behavior difference appears to show up only when an application does wrong things. As Joerg pointed out, mixing streams oriented file operations (which are managed by libc) with underlying file primitives is a no-no and will result in strange and/or undefined behavior. I do agree, however, that freopen() should work even if the file was close()'d. It does seem as though there is an issue with flushing the stream buffers after the file has been closed, however. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project