Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 1997 16:47:32 -0700 (PDT)
From:      nsayer@quack.kfu.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/4514: stdio does not flush on fork()
Message-ID:  <199709112347.QAA01738@zephyr.specialix.com>
Resent-Message-ID: <199709120000.RAA09897@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4514
>Category:       bin
>Synopsis:       stdio does not flush on fork()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 11 17:00:01 PDT 1997
>Last-Modified:
>Originator:     Nick Sayer
>Organization:
Just me
>Release:        FreeBSD 2.2.2-RELEASE i386
>Environment:

>Description:

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.

>How-To-Repeat:

#include <stdio.h>

main()
{

printf("this will appear twice.");

fork();

}

>Fix:

>Audit-Trail:
>Unformatted:



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