From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 4 10:10:06 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233261065694 for ; Fri, 4 Sep 2009 10:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DB1978FC20 for ; Fri, 4 Sep 2009 10:10:05 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n84AA56F043856 for ; Fri, 4 Sep 2009 10:10:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n84AA5Bu043855; Fri, 4 Sep 2009 10:10:05 GMT (envelope-from gnats) Resent-Date: Fri, 4 Sep 2009 10:10:05 GMT Resent-Message-Id: <200909041010.n84AA5Bu043855@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Petr Salinger Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4605B106566C for ; Fri, 4 Sep 2009 10:01:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 34BF28FC14 for ; Fri, 4 Sep 2009 10:01:27 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n84A1QlB089796 for ; Fri, 4 Sep 2009 10:01:26 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n84A1QA1089795; Fri, 4 Sep 2009 10:01:26 GMT (envelope-from nobody) Message-Id: <200909041001.n84A1QA1089795@www.freebsd.org> Date: Fri, 4 Sep 2009 10:01:26 GMT From: Petr Salinger To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/138526: /dev/null does not support nonblocking operation, fcntl(0, F_SETFL, O_NONBLOCK) fails 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: Fri, 04 Sep 2009 10:10:06 -0000 >Number: 138526 >Category: misc >Synopsis: /dev/null does not support nonblocking operation, fcntl(0,F_SETFL,O_NONBLOCK) fails >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 04 10:10:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Petr Salinger >Release: 7.2 >Organization: >Environment: >Description: /dev/null does not support nonblocking operation, fcntl(0,F_SETFL,O_NONBLOCK) fails The testsuite of coreutils 7.5 fails due to this. It is related also to http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/94729 I see no reason, why /dev/null and /dev/zero should operate differently in blocking and non-blocking mode, it should be sufficient to just ignore corresponding ioctl/fcntl in kernel. >How-To-Repeat: >Fix: In src/sys/dev/null/null.c add #include and into begining of null_ioctl() function + if (cmd == FIONBIO) + return 0; + if ((cmd == FIOASYNC) && ((*(int *)data) == 0)) + return 0; May be even + if (cmd == FIONBIO) + return 0; + if (cmd == FIOASYNC) + return 0; >Release-Note: >Audit-Trail: >Unformatted: