From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1F8BEBC48 for ; Mon, 7 Mar 2005 15:05:57 +0100 (CET) Received: from mail.lindows.com (mail.linspire.com [130.94.123.204]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j27E5uJB020875 for ; Mon, 7 Mar 2005 15:05:56 +0100 Received: by mail.lindows.com (Postfix, from userid 8) id 206E6160C16B; Mon, 7 Mar 2005 06:07:19 -0800 (PST) Received: from linspireinc.com (cpe-66-91-225-27.san.res.rr.com [66.91.225.27])by mail.lindows.com (Postfix) with ESMTPid 672D3160C16B; Mon, 7 Mar 2005 06:07:18 -0800 (PST) Message-ID: <422C5FC2.1010406@linspireinc.com> Date: Mon, 07 Mar 2005 06:05:54 -0800 From: David Fox User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20041201 Linspire/1.6-5.1.0.45.lindows0.83 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] printf and fork question References: <20050307144422.1e67bef6.micha-1@fantasymail.de> In-Reply-To: <20050307144422.1e67bef6.micha-1@fantasymail.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Lindows-Footer: yes X-Miltered: at concorde with ID 422C5FC4.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 printf:01 printf:01 prerr:01 endline:01 sprintf:01 getpid:01 getpid:01 waitpid:01 ocaml:01 caml-list:01 beginner's:01 ocaml:01 beginners:01 bug:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: 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.