From: z93john@mtek.chalmers.se (John I Quist)
Subject: Opening a fifo hangs
Date: 1999/02/18
Date: 1999-02-18T00:00:00+00:00 [thread overview]
Message-ID: <7agtmi$8a$1@nyheter.chalmers.se> (raw)
Hi!
I'm tring to establish communication between two processes on the same
Sun machine. (SunOS 5.6; running GNAT 3.05)
I have created two named pipes, and if I open two terminals, I can do
the following, without a problem:
In /dev/pts/3 (e.g.)
cat > mypipe
typetypetype
^D
In /dev/pts/4
cat mypipe
As expected, the text typed into the pipe on "pts/3" arrives neatly
on "pts/4"...
BUT, if I make a small Ada hack to open the pipes and read/write to them,
one program reads and the other writes, the program hangs.
The lines where execution halts are:
--- Write side ---
open(IN_F, IN_FILE, "/users/ztek/z93john/.comm_pipe");
------------------
--- Read side ---
open(OUT_F, OUT_FILE, "/users/ztek/z93john/.comm_pipe");
-----------------
(Both programs use TEXT_IO)
If I run "truss" to get the system calls, I find that both programs do
open("/users/ztek/z93john/.comm_pipe", O_RDONLY) (sleeping...)
BUT; if I kill the "writer" and do a
cat > .comm_pipe [Return]
the "reader" opens the fifo!
Why doesn't the writer open the pipe?
I have read the GNAT reference, and I didn't get much wiser...
- Is Ada doing something weird here, or is it me?
(As I understand it, the programs are supposed to block until both
ends of the pipe are open, but that's what I'm doing, isn't it?
Open for write on one end, read on the other...)
I would really appreciate an email copy of your replies.
Thank you!
/John.
next reply other threads:[~1999-02-18 0:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-18 0:00 John I Quist [this message]
1999-02-18 0:00 ` Opening a fifo hangs robert_dewar
1999-02-19 0:00 ` John I Quist
1999-02-19 0:00 ` robert_dewar
1999-02-22 0:00 ` John I Quist
1999-02-22 0:00 ` dennison
1999-02-22 0:00 ` John I Quist
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox