Bug 196345 - Ambiguity with select and EAGAIN in select_tut
Summary: Ambiguity with select and EAGAIN in select_tut
Status: RESOLVED CODE_FIX
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: 2017-07-12 16:18 UTC by Sergey Z.
Modified: 2017-07-22 07:46 UTC (History)
1 user (show)

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


Attachments

Description Sergey Z. 2017-07-12 16:18:38 UTC
In select_tut, Select law #7 there is a following statement:

"The  functions  read(2), recv(2), write(2), and send(2) as well as the select() call can return -1 with errno set to EINTR, or with errno set to EAGAIN (EWOULDBLOCK)."

But in select man page EAGAIN is not listed as possible error.

This can lead to confusion, e.g.:
https://stackoverflow.com/questions/4193043/select-on-a-pipe-in-blocking-mode-returns-eagain
Comment 1 Michael Kerrisk 2017-07-22 07:46:55 UTC
Thanks. I changed the text of rule 7 to:

       7.  Calls to read(2), recv(2), write(2), send(2), and select() can
           fail with the error  EINTR,  and  calls  to  read(2),  recv(2)
           write(2),  and  send(2)  can  fail  with  errno  set to EAGAIN
           (EWOULDBLOCK).  These results must be  properly  managed  (not
           done properly above).  If your program is not going to receive
           any signals, then it is unlikely you will get EINTR.  If  your
           program does not set nonblocking I/O, you will not get EAGAIN.

I'll close this now. If you think something still needs fixing here, please reopen.

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