caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: caml-list@inria.fr
Subject: Named pipe problem: is this a bug?
Date: Mon, 1 Aug 2005 17:03:42 +0200	[thread overview]
Message-ID: <F0577640-623F-4147-9745-300F4303D3E6@polytechnique.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

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



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

             reply	other threads:[~2005-08-01 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-01 15:03 Alan Schmitt [this message]
2005-08-01 15:41 ` [Caml-list] " Virgile Prevosto
2005-08-01 15:42 ` Damien Bobillot
2005-08-01 15:55 ` Richard Jones
2005-08-02  7:59 ` Alan Schmitt

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=F0577640-623F-4147-9745-300F4303D3E6@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=caml-list@inria.fr \
    /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).