From: Olivier Andrieu <andrieu@ijm.jussieu.fr>
To: micha-1@fantasymail.de
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] printf and fork question
Date: Mon, 07 Mar 2005 15:10:29 +0100 (CET) [thread overview]
Message-ID: <20050307.151029.41642248.oandrieu@nerim.net> (raw)
In-Reply-To: <20050307144422.1e67bef6.micha-1@fantasymail.de>
> Michael [Mon, 7 Mar 2005]:
> Hi,
>
> I don't understand why this:
>
> open Unix;;
> let _ =
> Printf.printf "Hi! %d\n" (getpid());
> match fork() with
> | 0 -> if fork() <> 0 then exit 0;
> ()
> | id -> ignore (waitpid [] id)
>
> prints out that:
> Hi! 12215
> Hi! 12215
> Hi! 12215
>
>
> with ocaml 3.08.2. Any hints?
You haven't flushed stdout : so the Hi! stays in the buffer and the
children inherit it.
--
Olivier
next prev parent reply other threads:[~2005-03-07 14:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-07 13:44 Michael
2005-03-07 13:57 ` [Caml-list] " Gerd Stolpmann
2005-03-07 14:03 ` Basile STARYNKEVITCH
2005-03-07 14:05 ` David Fox
2005-03-07 14:10 ` Olivier Andrieu [this message]
[not found] ` <6b8a9142050307060758200ad3@mail.gmail.com>
2005-03-07 14:12 ` Michael
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050307.151029.41642248.oandrieu@nerim.net \
--to=andrieu@ijm.jussieu.fr \
--cc=caml-list@yquem.inria.fr \
--cc=micha-1@fantasymail.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox