serial icon indicating copy to clipboard operation
serial copied to clipboard

syscall select has a limitations

Open kulti opened this issue 2 years ago • 0 comments

Hi, thank you for useful library!

I've found an issue. The select syscall has a limitations:

select() can monitor only file descriptors numbers that are less than FD_SETSIZE (1024)—an unreasonably low limit for many modern applications—and this limitation will not change. All modern applications should instead use poll(2) or epoll(7), which do not suffer this limitation.

https://man7.org/linux/man-pages/man2/select.2.html#DESCRIPTION

In practice it looks like, that fd is ready to read, but reads zero bytes.

I've made a PR to use poll (epoll is linux only syscall).

kulti avatar Dec 27 '21 07:12 kulti