From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr 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 C89B0BB88 for ; Mon, 1 Aug 2005 17:03:52 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j71F3qUB005137 for ; Mon, 1 Aug 2005 17:03:52 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA03046 for ; Mon, 1 Aug 2005 17:03:51 +0200 (MET DST) Received: from mx1.polytechnique.org (mx1.polytechnique.org [129.104.30.34]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j71F3pm6008949 for ; Mon, 1 Aug 2005 17:03:51 +0200 Received: from alan-schm1p.inria.fr (alan-schm1p.inria.fr [128.93.20.79]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTP id 14430331A7 for ; Mon, 1 Aug 2005 17:03:50 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by alan-schm1p.inria.fr (Postfix) with ESMTP id 970B018674A for ; Mon, 1 Aug 2005 17:03:45 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v733) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-1-720018457" To: caml-list@inria.fr From: Alan Schmitt Subject: Named pipe problem: is this a bug? Date: Mon, 1 Aug 2005 17:03:42 +0200 X-Pgp-Agent: GPGMail 1.1 (Tiger) X-Mailer: Apple Mail (2.733) X-AV-Checked: ClamAV using ClamSMTP at djali.polytechnique.org (Mon Aug 1 17:03:51 2005 +0200 (CEST)) X-DCC--Metrics: djali 32702; Body=1 Fuz1=1 Fuz2=1 X-Org-Mail: alan.schmitt.1995@polytechnique.org X-Miltered: at concorde with ID 42EE39D8.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42EE39D7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; schmitt:01 schmitt:01 bug:01 bug:01 endline:01 stdout:01 endline:01 stdout:01 ocamlc:01 bytecode:01 foo:01 unix:01 unix:01 terminates:01 compile:01 X-Attachments: type="application/pgp-signature" name="PGP.sig" name="PGP.sig" X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 --Apple-Mail-1-720018457 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello, I've stumbled upon a small bug, and I wonder if it's a OS X bug (I'm using X.4.2), or a caml bug. The problem is the following: I create a named pipe, then I open it. The open system call seems to block until there is data in the pipe. Here is a small program illustrating this: let _ = Unix.mkfifo "pipe_test" 0o640; print_endline "pipe created"; flush stdout; let chin = open_in "pipe_test" in print_endline "pipe opened"; flush stdout Compile it using "ocamlc unix.cma bug.ml" (the bug occurs both in bytecode and native code). When a.out is run, one sees: pipe created and the program keeps running. If one then does a echo foo >> pipe_test then the "pipe opened" line is shown, and the program terminates. Is this behaviour normal? Thanks, Alan Schmitt -- The hacker: someone who figured this out and made something cool happen. .O. ..O OOO --Apple-Mail-1-720018457 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFC7jnQNIAqM4hFUWgRAgC1AJ4sF8wtgl0cRCQmMmlnwDaYnGhFoACdGTOI uepIar5bx01ktLi6xDbrYP8= =Z1Sz -----END PGP SIGNATURE----- --Apple-Mail-1-720018457--