From owner-freebsd-current Fri Jan 9 17:48:05 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA07726 for current-outgoing; Fri, 9 Jan 1998 17:48:05 -0800 (PST) (envelope-from owner-freebsd-current) Received: from nash.pr.mcs.net (nash.pr.mcs.net [204.95.47.72]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA07693 for ; Fri, 9 Jan 1998 17:47:46 -0800 (PST) (envelope-from alex@nash.pr.mcs.net) Received: (from alex@localhost) by nash.pr.mcs.net (8.8.8/8.8.7) id TAA25178; Fri, 9 Jan 1998 19:45:37 -0600 (CST) (envelope-from alex) Message-Id: <199801100145.TAA25178@nash.pr.mcs.net> Date: Fri, 9 Jan 1998 19:45:37 -0600 (CST) From: Alex Nash Reply-To: nash@mcs.net Subject: Re: Non-Posixly Correct pipe() and socketpair() To: nathan@rtfm.net cc: freebsd-current@freebsd.org In-Reply-To: <19980109191945.48808@rtfm.net> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On 9 Jan, Nathan Dorfman wrote: > Here's a quick question that arose in #unix yesterday. Why does FreeBSD > have a bi-directional pipe() call when socketpair() does exactly this? > What benefits does making pipe() bi as well have? Doesn't this break POSIX > and introduce a new generation of Berkeleyisms? IEEE 1003.1 1996 states the following in section B.6.1: An implementation that fails write() operations on fildes[0] or read()s on fildes[1] is not required. Historical implementations (Version 7 and System V) return the error [EBADF] in such cases. This allows implementations to set up a second pipe for full duplex operation at the same time. A conforming application that uses the pipe() function as described in POSIX.1 will succeed whether this second pipe is present or not. Alex