Skip site navigation (1)Skip section navigation (2)
Date:      12 May 2001 16:34:36 -0000
From:      clemens fischer <ino-waiting@gmx.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/27287: poll(2) returns 0 when POLLIN-ing ordinary files
Message-ID:  <20010512163436.3789.qmail@spotteswoode.yi.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010512163436.3789.qmail>