Bug 199131

Summary: epoll(7) claims read never returns early
Product: Documentation Reporter: David Klempner (klempner)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: NEW ---    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

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