From owner-freebsd-current@FreeBSD.ORG Tue Feb 3 08:54:29 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E71216A4CE; Tue, 3 Feb 2004 08:54:29 -0800 (PST) Received: from sweeper.openet-telecom.com (mail.openet-telecom.com [62.17.151.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7F0E43D48; Tue, 3 Feb 2004 08:54:26 -0800 (PST) (envelope-from peter.edwards@openet-telecom.com) Received: from mail.openet-telecom.com (unverified) by sweeper.openet-telecom.com ; Tue, 3 Feb 2004 16:55:50 +0000 Received: from openet-telecom.com (10.0.3.126) by mail.openet-telecom.com (NPlex 6.5.027) (authenticated as Peter@openet-telecom.com) id 401F702800000D7C; Tue, 3 Feb 2004 16:55:47 +0000 Message-ID: <401FD23A.9070407@openet-telecom.com> Date: Tue, 03 Feb 2004 16:54:18 +0000 From: Peter Edwards User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040120 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= References: <401FCCBE.2010008@openet-telecom.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: Robert Watson cc: current@FreeBSD.org Subject: Re: Coalescing pipe allocation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 16:54:29 -0000 Dag-Erling Smørgrav wrote: >Peter Edwards writes: > > >>How would one "shut down" one direction of the pipe and still maintain >>the other? I don't know how I can signal my intention not to read or >>write to the end I leave open... >> >> > >man 2 shutdown > > Shutdown requires a socket, and won't play with pipes: $ cat t.c #include #include #include #include int main() { int p[2]; if (pipe(p) == -1) err(-1, "pipe"); if (shutdown(p[0], SHUT_RD) == -1) err(-1, "shutdown"); return 0; } $ cc -o t ./t.c $ ./t ./t: shutdown: Socket operation on non-socket $ > > >>Is this portability issue so ridiculously out of date that the comment >>in the pipe(2) manpage should be removed, or at least toned down? >> >> > >No, POSIX only guarantees the traditional behaviour. Bi-directional >pipes are a non-portable BSDism. > > > >> It >>seems silly to incur the costs of implementation you've mentioned and >>then recommend that the feature not be used. >> >> > >It can still be useful for programs in the base system, which do not >need to be unconditionally portable to non-BSD systems. > > Fair 'nuff.