From owner-freebsd-bugs Thu Jul 18 08:50:07 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA27896 for bugs-outgoing; Thu, 18 Jul 1996 08:50:07 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA27886; Thu, 18 Jul 1996 08:50:02 -0700 (PDT) Resent-Date: Thu, 18 Jul 1996 08:50:02 -0700 (PDT) Resent-Message-Id: <199607181550.IAA27886@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, markd@Grizzly.COM Received: from scruz.net (nic.scruz.net [165.227.1.2]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA27524 for ; Thu, 18 Jul 1996 08:41:53 -0700 (PDT) Received: from Grizzly.COM by scruz.net (8.7.3/1.34) id IAA12770; Thu, 18 Jul 1996 08:41:50 -0700 (PDT) Received: (from markd@localhost) by Grizzly.COM (8.7.5/8.7.3) id UAA06069; Thu, 18 Jul 1996 20:42:46 -0700 (PDT) Message-Id: <199607190342.UAA06069@Grizzly.COM> Date: Thu, 18 Jul 1996 20:42:46 -0700 (PDT) From: Mark Diekhans Reply-To: markd@Grizzly.COM To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/1397: can't send to a pipe Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1397 >Category: kern >Synopsis: can't send to a pipe >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 18 08:50:01 PDT 1996 >Last-Modified: >Originator: Mark Diekhans >Organization: == Mark Diekhans == >Release: FreeBSD 2.2-960612-SNAP i386 >Environment: >Description: 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. This worked on 2.1. >How-To-Repeat: #include #include #include int main () { int fds [2]; struct stat statBuf; char *data; if (pipe (fds) < 0) { perror ("pipe"); exit (1); } if (fstat (fds [1], &statBuf)) { perror ("fstat"); exit (1); } printf ("pipe mode is: %o\n", statBuf.st_mode); data = "some data to write"; if (send (fds [1], data, strlen (data), 0) < 0) { perror ("but doing a send fails"); exit (1); } exit (0); } >Fix: Unknown. >Audit-Trail: >Unformatted: