2 ms·
Also worth noting, in Mac OS X and other BSDs pipes are bidirectional. I assumed that was some Snow Leopard craziness, but it comes from System V.4 in 1988. Th
by jws 17y ago
Also worth noting, in Mac OS X and other BSDs pipes are bidirectional. I assumed that was some Snow Leopard craziness, but it comes from System V.4 in 1988.
There must be a theological divide on the matter judging from the wording of the GNU man page which proudly proclaims pipes unidirectional.
- prodigal_erik 17y agoshutdown(2) lets you report EOF while still reading from a socket, so you can cleanly receive your peer's messages and EOF. Pipes only support close(2), so you can't report EOF without forcing your peer to handle SIGPIPE/EPIPE as well as ignoring anything else they want to send. And if your peer is writing and doesn't expect reads to work also (POSIX doesn't call for it), your own writes are just going to block and never be read.