Thomas said:
This all depends on the type of Unix pipe you are talking about, and on
the heritage of the particular Unix version.
Classic Unix pipes need not use sockets at all. In SVR4 these ones are
implemented on top of the streams io framework. In older AT&T Unix
version it was just some particular code in the kernel.
So called stream pipes are socked-based in BSD Unix systems, and simply
pipes-based in SVR4.
It's been a while since I did any programming requiring pipes. In those days the
pipe system call returned a pair of file descriptors, one for read and one for
write. It was the responsibility of the programmer to ensure that the correct
end of each was closed in the parent/child to allow correct communications.
As in all fields, progress has been made (but not necessarily in the
documentation). According to the man pages for Linux/IRIX/Solaris the pipe
system call still returns a classic, uni-directional pipe. To further confuse
matters IRIX implements 2 versions of pipe, one with the conventional SVR3.2
uni-directional semantics and another with the bi-directional SVR4 semantics,
controlled either by a kernel tunable parameter, or the library linked at
runtime.
Which type of pipe is really returned remains a mystery...
Regarding SVR4,
pipes.
here the normal pipe is already bi-directional (due to the
implementation on top of the streams io framework). When you ask for a
pipe, you always get a bi-directional one in SVR4. While on BSD systems
you have to ask for a socket pair to get a bi-directional one (or use
two normal pipes).
Sorry, what I meant to say was that Pipe is uni-directional. According to the
API Javadocs it implements a uni-directional pipe.