From owner-freebsd-bugs Thu Jul 18 11:29:17 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA07483 for bugs-outgoing; Thu, 18 Jul 1996 11:29:17 -0700 (PDT) Received: from skynet.ctr.columbia.edu (skynet.ctr.columbia.edu [128.59.64.70]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA07472 for ; Thu, 18 Jul 1996 11:29:12 -0700 (PDT) Received: (from wpaul@localhost) by skynet.ctr.columbia.edu (8.6.12/8.6.9) id OAA14569; Thu, 18 Jul 1996 14:25:02 -0400 From: Bill Paul Message-Id: <199607181825.OAA14569@skynet.ctr.columbia.edu> Subject: Re: kern/1397: can't send to a pipe To: j@uriah.heep.sax.de Date: Thu, 18 Jul 1996 14:25:00 -0400 (EDT) Cc: markd@Grizzly.COM, bugs@freefall.freebsd.org In-Reply-To: <199607181700.KAA02495@freefall.freebsd.org> from "J Wunsch" at Jul 18, 96 10:00:01 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Of all the gin joints in all the towns in all the world, J Wunsch had to walk into mine and say: > The following reply was made to PR kern/1397; it has been noted by GNATS. > From: J Wunsch > To: markd@Grizzly.COM > Cc: FreeBSD-gnats-submit@freebsd.org > Subject: Re: kern/1397: can't send to a pipe > Date: Thu, 18 Jul 1996 18:48:35 +0200 (MET DST) > > As Mark Diekhans wrote: > > > Pipes are implemented as sockets and this is what fstat > > reports. However send returns a "Socket operation on non-socket" > > error. Either socket operations should work or fstat should report > > the file as a FIFO, not a socket. > > Pipes are no longer implemented as sockets. Using socket operations > on them was illegal all the time, even if the kernel has not been > reporting the error. > > Pipes are no longer reported by fstat (i think this is an error, or > at least an omission): [chop] He didn't mean fstat(1), he meant fstat(2). Look at the sample source he supplied: he's calling fstat(2) on one of the pipe descriptors returned by pipe(2) and he says he's getting S_IFSOCK as a result. However since John's new pipe code does not in fact (ab)use sockets, attempts to use socket system calls on the descriptors fail. This is a contradiction: if socket operations won't work, fstat(2) should not identify the descriptors as S_IFSOCK. In this case, he could replace pipe(2) with socketpair(2) in the application, but that doesn't change the fact that fstat(2) is reporting a bogus result. I suppose a new type has to be added (S_IPIPE?), but a question (in my mind at least) of compatibility with other *BSD systems. -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= "If you're ever in trouble, go to the CTR. Ask for Bill. He will help you." =============================================================================