bidirectional named pipe?

From: Miller, Brendan (
Date: Fri Feb 02 2001 - 19:33:09 EST

I've countless web searches and linux-kernel archives, but I haven't yet
found the answer to my question.

I'm porting some software to Linux that requires use of a bidirectional,
named pipe. The architecture is as follows: A server creates a named pipe
in the /tmp directory. Any client can then open("/tmp/pipename",
O_RDWR|O_NDELAY) and gain access to the server. The pipe is bidirectional,
so the client and server communicate on the same pipe. I support a number
of clients on the single pipe using file-locking to prohibit from two
clients from writing/reading at once.

How can I do this under Linux? In SVR4 Unices, I just use pipe() as it's
pipes are bidirectional, and I can attach a name with fattach(). In SVR3
Unices, I go through a bunch of hacking using the "stream clone device --
/dev/spx". I experiemented with socket-based pipes under Linux, but I
couldn't gain access to them by open()ing the name. Is there help? I
really don't want to use LiS (the Linux Streams) package, as I'd rather do
something native and not be dependent on another module. Plus, I read
somewhere that this was a poor way to do things.


Please cc: me personally, as I am not subscribed.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:17 EST