From owner-freebsd-bugs Sat Mar 3 10:40: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 64E8537B720 for ; Sat, 3 Mar 2001 10:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f23Ie1w09472; Sat, 3 Mar 2001 10:40:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B3E0C37B718 for ; Sat, 3 Mar 2001 10:37:36 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f23IbaS06130; Sat, 3 Mar 2001 10:37:36 -0800 (PST) (envelope-from nobody) Message-Id: <200103031837.f23IbaS06130@freefall.freebsd.org> Date: Sat, 3 Mar 2001 10:37:36 -0800 (PST) From: steve@bleazard.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/25511: ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25511 >Category: kern >Synopsis: ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Mar 03 10:40:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Steve Bleazard >Release: 4.2 >Organization: Home >Environment: FreeBSD fbsd42.pcug.co.uk 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Thu Feb 8 09:49:1 8 GMT 2001 root@fbsd42.pcug.co.uk:/usr/src/sys/compile/AMS i386 >Description: ioctl(fd, FIONREAD, &c) on a fifo file (created with mkfifo(2)) always returns 0. >How-To-Repeat: call ioctl(fd, FIONREAD, &c) on a fifo which has data to read. >Fix: The problem appears to be with fifo_vnops.c in /usr/src/sys/miscfs/fifofs. The code to handle the ioctl calls soo_ioctl for both read and write halves of the stream in that order. This is because the a_fflag is set to FREAD|FWRITE. Special casing FIONREAD to only call the read half fixes the problem. I have no experience with the FreeBSD kernel so have no idea if this is a correct fix. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message