public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bidirectional named pipe?
@ 2001-02-03  0:33 Miller, Brendan
  2001-02-03  0:47 ` J . A . Magallon
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Miller, Brendan @ 2001-02-03  0:33 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'


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.

Brendan

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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: bidirectional named pipe?
@ 2001-02-03  0:49 Miller, Brendan
  0 siblings, 0 replies; 13+ messages in thread
From: Miller, Brendan @ 2001-02-03  0:49 UTC (permalink / raw)
  To: 'J . A . Magallon', Miller, Brendan
  Cc: 'linux-kernel @ vger . kernel . org'

I thought mkfifo was only unidirectional...

Brendan

Please cc: me personally, as I am not subscribed.

-----Original Message-----
From: J . A . Magallon [mailto:jamagallon@able.es]
Sent: Friday, February 02, 2001 4:47 PM
To: Miller, Brendan
Cc: 'linux-kernel @ vger . kernel . org'
Subject: Re: bidirectional named pipe?


Perhaps man 2 mkfifo ?

On 02.03 "Miller, Brendan" wrote:
> 
> 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.
> 
> Brendan
> 
> 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 majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
> 
-- 
J.A. Magallon                                                      $> cd pub
mailto:jamagallon@able.es                                          $> more
beer

Linux werewolf 2.4.1-ac1 #2 SMP Fri Feb 2 00:19:04 CET 2001 i686
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: bidirectional named pipe?
@ 2001-02-03  4:55 Miller, Brendan
  0 siblings, 0 replies; 13+ messages in thread
From: Miller, Brendan @ 2001-02-03  4:55 UTC (permalink / raw)
  To: Miller, Brendan; +Cc: 'linux-kernel @ vger . kernel . org'


Many thanks to all who have suggested to use UNIX domain sockets.  That was
my first thought--I just didn't know how to preserve the existing named
interface.  And yes, I have consulted several "decent" UNIX programming
books which have led me to the likelihood that what I want to do cannot be
done under Linux.  A shame, really, even if it is a travestible, abominable
way to do it.

The common, named pipe interface was a way to maintain compatibility with
legacy code of previous versions that are already out in the field.  If I
change the architecture now, folks porting from UnixWare to Linux (for
example) will have to change their applications (maybe--I haven't fully
analyzed whether I can change the underlying behavior without affecting our
API) in order to use Linux.

I am aware that the current design may not be the most efficient, or even
the most portable, but I was hoping to maintain it for compatibility sake.
If someone wants to tell me how to do it, great.  If not, I'll assume it
can't be done and start reworking everything to use socket() or
socketpair().

Thanks all,

Brendan

Please cc: me on all replies.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-02-11  1:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-03  0:33 bidirectional named pipe? Miller, Brendan
2001-02-03  0:47 ` J . A . Magallon
2001-02-03  2:41 ` Wakko Warner
2001-02-03  7:51 ` Alan Cox
2001-02-03 14:28   ` Jamie Lokier
2001-02-07 23:09   ` David L. Nicol
2001-02-08 23:10     ` H. Peter Anvin
2001-02-10  5:12       ` Chris Wedgwood
2001-02-11  1:38         ` H. Peter Anvin
2001-02-10  0:31     ` David L. Nicol
2001-02-10  1:37       ` Doug McNaught
  -- strict thread matches above, loose matches on Subject: below --
2001-02-03  0:49 Miller, Brendan
2001-02-03  4:55 Miller, Brendan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox