Bug 66571 - epoll_wait has it wrong about timeout and EINTR
Summary: epoll_wait has it wrong about timeout and EINTR
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 low
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-05 08:05 UTC by Jonas Jonsson
Modified: 2014-01-22 13:14 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Jonas Jonsson 2013-12-05 08:05:59 UTC
The epoll_wait(2) man page says:

"EINTR  The call was interrupted by a signal handler before either any
        of the requested events occurred or the timeout expired; see
        signal(7)."

Looking at the code of the kernel, EINTR is only returned when there is a pending signal. If the timeout expires, it will simply return without an error.

Simply removing the "or the timeout expired" part should be enough.
Comment 1 Michael Kerrisk 2014-01-22 13:14:09 UTC
The problem is that the wording is a little ambiguous. The meaning is this:

EINTR  The call was interrupted by a signal handler before either (1) any
       of the requested events occurred or (2) the timeout expired; see
       signal(7).

I've updated the page to have the text as shown above.

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