u8-ready? and char-ready? Lassi Kortela 04 Mar 2020 12:45 UTC

> R7RS provides u8-ready? and char-ready?    (a non-blocking check for
> more input available or EOF)
>
> ...but these custom ports do not provides hooks to implement them.

I never noticed these R7RS procedures before. How are they implemented
in the general case? On Unix, blocking vs non-blocking mode is a
property of a file object the kernel. If more than one file descriptor
shares the same file object (via dup() or dup2()), one of them can
toggle the non-blocking flag behind the other's back at any time, even
(or especially) if the file descriptors live in different processes.

Is select()/poll() usable for a u8-ready? check that doesn't depend on
the blocking mode of the underlying file object?