Subject: Re: bi-directional pipes?
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Jorgen Lundman <>
List: tech-kern
Date: 02/05/2003 11:15:35
I must admin I have used, and do use, bi-directional pipes. I like the 
idea of sitting in a select() / poll() for all my IO, sockets, files and 
child/spanwed processes, and using both read() and write() on the one 
socket. To be portable I then have to either;

- use two pipes just for child/spawned process communication
- use socketpair() to ensure bi-directional.

As it happens I tend to go for tha latter as it will work under Win32 as 
well (manual socketpair though) with nonblocking etc.

Just my 2p and just a weak argument (clean code) :)


David Laight wrote:
>>In the commercial UNIX world it's been this way for many many years now.
>>I would not be suprised at all if there were not many applications
>>depending on this well documented behaviour.
> At least 15 years....
> There are also likely to be applications that rely on fattach().
> Although posix only requires it for streams, SVR4 allows it for
> any char special or pipe device.
> For the uninitiated, fattach() effectively mounts a fd onto a
> file system node.
> Welcome to the 1980's :-)
> 	David

Jorgen Lundman       | <>
Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo    | +81 (0)90-5578-8500          (cell)
Japan                | +81 (0)3 -3375-1767          (home)