From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 13 12:31:07 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EED4B16A41F; Tue, 13 Sep 2005 12:31:06 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C192C43D46; Tue, 13 Sep 2005 12:31:06 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from freefall.freebsd.org (rwatson@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8DCV6oY025878; Tue, 13 Sep 2005 12:31:06 GMT (envelope-from rwatson@freefall.freebsd.org) Received: (from rwatson@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8DCV6Ms025874; Tue, 13 Sep 2005 12:31:06 GMT (envelope-from rwatson) Date: Tue, 13 Sep 2005 12:31:06 GMT From: Robert Watson Message-Id: <200509131231.j8DCV6Ms025874@freefall.freebsd.org> To: rwatson@FreeBSD.org, freebsd-bugs@FreeBSD.org, rwatson@FreeBSD.org Cc: Subject: Re: kern/25511: ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2005 12:31:07 -0000 Synopsis: ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work Responsible-Changed-From-To: freebsd-bugs->rwatson Responsible-Changed-By: rwatson Responsible-Changed-When: Tue Sep 13 11:50:11 GMT 2005 Responsible-Changed-Why: Take ownership of this bug, as I have recently been writing regression tests and fixing fifofs bugs. I have reproduced this bug with a local test program, and believe the description is correct (that the useful result of FIONREAD from the read socket is overwritten with the less useful result of FIONWRITE on the write socket for O_RDWR fifo descriptors). According to POSIX, all this is undefined, but useful behavior would be useful. We may want to handle each ioctl specifically before passing to the socket layer rather than relying on fall-through for precisely this reason (that other ioctls may also be failing oddly). http://www.freebsd.org/cgi/query-pr.cgi?pr=25511