Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 1997 01:50:01 -0700 (PDT)
From:      John-Mark Gurney <gurney_j@efn.org>
To:        freebsd-bugs
Subject:   Re: bin/4514: stdio does not flush on fork()
Message-ID:  <199709120850.BAA17954@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/4514; it has been noted by GNATS.

From: John-Mark Gurney <gurney_j@efn.org>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709120850.BAA17954>