Date: Thu, 18 Jul 1996 14:25:00 -0400 (EDT) From: Bill Paul <wpaul@skynet.ctr.columbia.edu> To: j@uriah.heep.sax.de Cc: markd@Grizzly.COM, bugs@freefall.freebsd.org Subject: Re: kern/1397: can't send to a pipe Message-ID: <199607181825.OAA14569@skynet.ctr.columbia.edu> In-Reply-To: <199607181700.KAA02495@freefall.freebsd.org> from "J Wunsch" at Jul 18, 96 10:00:01 am
next in thread | previous in thread | raw e-mail | index | archive | help
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 <j@uriah.heep.sax.de> > 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." =============================================================================
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607181825.OAA14569>