Bug 199131 - epoll(7) claims read never returns early
Summary: epoll(7) claims read never returns early
Status: NEW
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-17 09:41 UTC by David Klempner
Modified: 2020-04-23 10:53 UTC (History)
1 user (show)

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


Attachments

Description David Klempner 2018-03-17 09:41:18 UTC
epoll(7) has a section under A9 on whether it is okay to stop reading early without having seen EAGAIN when using edge triggered epoll:

"For example, if you call read(2) by asking to read a certain amount of data and read(2) returns a lower number of bytes, you can be sure of having exhausted the read I/O space for the file descriptor."

This is incorrect. Notably, if you receive a signal in the middle of such a read it will return early with a partial read. This can happen even in the case of non-blocking reads.
Comment 1 Michael Kerrisk 2020-04-23 10:53:38 UTC
David,

Can you provide further information on how you verified this behavior?

Thanks,

Michael

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