From owner-freebsd-bugs Fri Sep 12 01:50:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA17968 for bugs-outgoing; Fri, 12 Sep 1997 01:50:06 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA17954; Fri, 12 Sep 1997 01:50:01 -0700 (PDT) Date: Fri, 12 Sep 1997 01:50:01 -0700 (PDT) Message-Id: <199709120850.BAA17954@hub.freebsd.org> To: freebsd-bugs Cc: From: John-Mark Gurney Subject: Re: bin/4514: stdio does not flush on fork() Reply-To: John-Mark Gurney Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR bin/4514; it has been noted by GNATS. From: John-Mark Gurney To: nsayer@quack.kfu.com Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/4514: stdio does not flush on fork() Date: Fri, 12 Sep 1997 01:41:55 -0700 nsayer@quack.kfu.com scribbled this message on Sep 11: > If the stdio buffers are not flushed, a fork() will replicate > the filled buffer to the child, resulting in doubling the data. > It is inconsistent, however you slice it, to have one printf > call result in multiple outputs. I think this is actually a user error... fork is a system call.. and teaching a system call about how to use a library isn't a very good idea... so you just need to make sure you: fflush(NULL); before you fork... -- John-Mark Gurney Modem/FAX: +1 541 683 6954 Cu Networking Live in Peace, destroy Micro$oft, support free software, run FreeBSD