go-serial icon indicating copy to clipboard operation
go-serial copied to clipboard

syscall select has limitations

Open kulti opened this issue 3 years ago • 2 comments

Hi, 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 found this issue using another library. At first, I try to find alternative implementations for serial and found your library with similar issue. I did not try to reproduce it with your library, but is should not make sense, because the problem in using the syscall select. You can look at my PR https://github.com/goburrow/serial/pull/20/files for reference of syscall poll usage.

kulti avatar Dec 27 '21 07:12 kulti

Any update on the status of this?

12bchl avatar Nov 03 '22 16:11 12bchl

I'm not planning to do it. At least in the short term... If anyone is willing to give it a try I may review a PR (or at least it will be available to others to try).

cmaglie avatar Nov 25 '22 14:11 cmaglie