diff options
| author | Niklas Hambüchen <mail@nh2.me> | 2017-09-26 14:41:50 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-26 15:39:18 -0400 |
| commit | 8f468fe05cf81ca516b3a8cf66792f842dbfcf40 (patch) | |
| tree | 286624235d7c5db73a958d1f83ff2c515c1f1ac8 | |
| parent | 1825cbdbdf08ed4bd6fd6794852596078953298a (diff) | |
| download | haskell-8f468fe05cf81ca516b3a8cf66792f842dbfcf40.tar.gz | |
base: fdReady(): Add note about O_NONBLOCK requirement
Reviewers: bgamari, austin, hvr
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3962
| -rw-r--r-- | libraries/base/cbits/inputReady.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/base/cbits/inputReady.c b/libraries/base/cbits/inputReady.c index 481c9de90e..c0b1a49555 100644 --- a/libraries/base/cbits/inputReady.c +++ b/libraries/base/cbits/inputReady.c @@ -32,7 +32,11 @@ * inputReady(fd) checks to see whether input is available on the file * descriptor 'fd' within 'msecs' milliseconds (or indefinitely if 'msecs' is * negative). "Input is available" is defined as 'can I safely read at least a - * *character* from this file object without blocking?' + * *character* from this file object without blocking?' (this does not work + * reliably on Linux when the fd is a not-O_NONBLOCK socket, so if you pass + * socket fds to this function, ensure they have O_NONBLOCK; + * see `man 2 poll` and `man 2 select`, and + * https://ghc.haskell.org/trac/ghc/ticket/13497#comment:26). * * This function blocks until either `msecs` have passed, or input is * available. |
