Re: Kernel 2.2.x bug. Standard output not flushed before fork

Ricardo Galli Granada (gallir@atlas-iap.es)
Mon, 7 Jun 1999 23:12:47 +0200 (MEST)


> This is not good, isn't it?. Well, I have a program that
> creates one o more process. Before fork, the father
> process write some messages to standard output and then it
> creates some sons. The problem is sons inherit
> father's non flushed standard output, so father's messages
> appear two o more times. If I flush standard output before
> fork(), all is fine -- that is, father's messages appear
> once.

If you used printf/fprintf functions, that's normal (puts normally flushes
buffers, at least in libc5). They use internal, user land buffers
implemented in libc (according to ANSI). I's not a kernel topic and the
kernel can do nothing in this case, the userland buffers and states are
copied with fork.

--
Ricardo Galli

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/