View Issue Details

IDProjectCategoryView StatusLast Update
00006831003.1(2013)/Issue7+TC1System Interfacespublic2019-06-10 08:55
Reporterphilip-guenther Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted 
NamePhilip Guenther
OrganizationOpenBSD
User Reference
Sectionpoll()
Page Number1417
Line Number46793-46795
Interp Status---
Final Accepted Text
Summary0000683: return value of poll() unclear when multiple pollfds have the same fd
DescriptionWhat should poll() return if multiple pollfd structures passed to it have the same 'fd' value and more than one of those has a non-zero revents on return?

First off, it should be noted that nothing in the description bans such a call, so I don't think an error return is permitted for that cause.

The RETURN VALUE section of the poll() page states:
    Upon successful completion, poll() shall return a non-negative value.
    A positive value indicates the total number of file descriptors that
    have been selected (that is, file descriptors for which the revents
    member is non-zero).

Saying that it's a count of the "file descriptors" would seem to mean that no matter how many pollfds reference the given fd, the return value must only be incremented by one. However, the systems I've tested (Solaris 10, FreeBSD 8, Linux 2.6.18, OpenBSD 5.2) all return the total number of pollfd structures that have revents non-zero.
Desired ActionChange this:
    Upon successful completion, poll() shall return a non-negative value.
    A positive value indicates the total number of file descriptors that
    have been selected (that is, file descriptors for which the revents
    member is non-zero).

to something like this:
    Upon successful completion, poll() shall return a non-negative value.
    A positive value indicates the total number of pollfd structures that
    have selected events (that is, those for which the revents member is
    non-zero).

Tagstc2-2008

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2013-04-24 22:16 philip-guenther New Issue
2013-04-24 22:16 philip-guenther Name => Philip Guenther
2013-04-24 22:16 philip-guenther Organization => OpenBSD
2013-04-24 22:16 philip-guenther Section => poll()
2013-04-24 22:16 philip-guenther Page Number => 1417
2013-04-24 22:16 philip-guenther Line Number => 46793-46795
2013-04-25 16:11 Don Cragun Interp Status => ---
2013-04-25 16:11 Don Cragun Status New => Resolved
2013-04-25 16:11 Don Cragun Resolution Open => Accepted
2013-04-25 16:11 Don Cragun Tag Attached: tc2-2008
2019-06-10 08:55 agadmin Status Resolved => Closed