From owner-freebsd-hackers Fri Sep 20 11:54:32 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA11150 for hackers-outgoing; Fri, 20 Sep 1996 11:54:32 -0700 (PDT) Received: from night.primate.wisc.edu (night.primate.wisc.edu [144.92.43.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA11075; Fri, 20 Sep 1996 11:54:25 -0700 (PDT) Received: by night.primate.wisc.edu; id NAA00906; 8.6.10/41.8; Fri, 20 Sep 1996 13:58:20 -0500 From: Paul DuBois Message-Id: <199609201858.NAA00906@night.primate.wisc.edu> Subject: Re: libc_r bug To: hsu@freefall.freebsd.org (Jeffrey Hsu) Date: Fri, 20 Sep 1996 13:58:20 -0500 (CDT) Cc: hackers@freefall.freebsd.org In-Reply-To: <199609200828.BAA01366@freefall.freebsd.org> from "Jeffrey Hsu" at Sep 20, 96 01:28:29 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >The following program exhibits a bug in the latest version of libc_r. >If the two lines are reversed, then everything's okay. > >main() >{ > write(1, "hi", 2); > printf("hello world\n"); >} What happens, and what do you expect to happen? You're mixing stdio (buffered) and non-stdio (unbuffered) I/O. Unpredictable results will often ensue.