From owner-freebsd-bugs Sat May 12 9:40: 8 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 E544337B43F for ; Sat, 12 May 2001 09:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4CGe1h24953; Sat, 12 May 2001 09:40:01 -0700 (PDT) (envelope-from gnats) Received: from mout1.freenet.de (mout1.freenet.de [194.97.50.132]) by hub.freebsd.org (Postfix) with ESMTP id D9C8F37B43F for ; Sat, 12 May 2001 09:34:34 -0700 (PDT) (envelope-from toor@spotteswoode.yi.org) Received: from [194.97.50.135] (helo=mx2.freenet.de) by mout1.freenet.de with esmtp (Exim 3.22 #1) id 14ycLh-0006TH-00 for FreeBSD-gnats-submit@freebsd.org; Sat, 12 May 2001 18:34:33 +0200 Received: from a103a.pppool.de ([213.6.16.58] helo=spotteswoode.yi.org) by mx2.freenet.de with asmtp (ID inode@freenet.de) (Exim 3.22 #1) id 14ycLg-0003Gm-00 for FreeBSD-gnats-submit@freebsd.org; Sat, 12 May 2001 18:34:33 +0200 Received: (qmail 3790 invoked by uid 0); 12 May 2001 16:34:36 -0000 Message-Id: <20010512163436.3789.qmail@spotteswoode.yi.org> Date: 12 May 2001 16:34:36 -0000 From: clemens fischer To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/27287: poll(2) returns 0 when POLLIN-ing ordinary files Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 27287 >Category: kern >Synopsis: poll(2) returns 0 when POLLIN-ing ordinary files >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 12 09:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Super >Release: FreeBSD 4.0-RELEASE i386 >Organization: privat >Environment: the bug is in freebsd 4 and can be verified using the follwing code snipet. >Description: given a file "trypoll.c" (for relevant lines see below), poll does not see that input is ready immediately. the following code-snipet returns 0 for the return value and also 0 in x.revents. x.fd = open("trypoll.c",O_RDONLY); if (x.fd == -1) _exit(111); x.events = POLLIN; if (poll(&x,1,10) == -1) _exit(1); if (x.revents != POLLIN) _exit(1); >How-To-Repeat: see above. >Fix: there is a workaround for poll(2) based on select(2). it is contained in iopoll.c of the package cvm-0.6 (Credential Verification Module) by bruce guenther. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message