Bug 33022 - incorrect return value when calling select() on an epoll descriptor
Summary: incorrect return value when calling select() on an epoll descriptor
Status: RESOLVED INVALID
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: io_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-11 03:05 UTC by Mark Heily
Modified: 2011-04-11 03:13 UTC (History)
0 users

See Also:
Kernel Version: Debian "squeeze" 2.6.32-5-amd64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
test case (3.02 KB, text/x-csrc)
2011-04-11 03:05 UTC, Mark Heily
Details

Description Mark Heily 2011-04-11 03:05:23 UTC
Created attachment 54012 [details]
test case

The epoll(7) manpage states the following:

        Q3  Is the epoll file descriptor itself poll/epoll/selectable?

       A3  Yes.  If an epoll file descriptor has events waiting then  it  will
           indicate as being readable.

It appears that this functionality is broken. I have attached a testcase that uses select() to test an epoll descriptor for readability. The return value of select() is zero, even though the epoll descriptor has events waiting.
Comment 1 Mark Heily 2011-04-11 03:13:12 UTC
Sorry, this is not a kernel bug.. I misinterpreted the usage of the "nfds" argument to select(), it should be the value of the epoll descriptor + 1.

Note You need to log in before you can comment on or make changes to this bug.