caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Fox <david.fox@linspireinc.com>
To: Michael <micha-1@fantasymail.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] printf and fork question
Date: Mon, 07 Mar 2005 06:05:54 -0800	[thread overview]
Message-ID: <422C5FC2.1010406@linspireinc.com> (raw)
In-Reply-To: <20050307144422.1e67bef6.micha-1@fantasymail.de>

It looks like a side effect of Printf.printf.  Try prerr_endline 
(Printf.sprintf "Hi! %d\n" (getpid ())) instead.

Michael wrote:

>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?
>
> Michael
>
>_______________________________________________
>Caml-list mailing list. Subscription management:
>http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>Archives: http://caml.inria.fr
>Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>Bug reports: http://caml.inria.fr/bin/caml-bugs
>  
>
--

This message contains information which may be confidential and privileged. Unless you are the 
addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone 
the message or any information contained in the message. If you have received the message in error, 
please advise the sender and delete the message.  Thank you.


  parent reply	other threads:[~2005-03-07 14:05 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 [this message]
2005-03-07 14:10 ` Olivier Andrieu
     [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=422C5FC2.1010406@linspireinc.com \
    --to=david.fox@linspireinc.com \
    --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;
as well as URLs for NNTP newsgroup(s).