Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: use poll api instead of select inorder to support fd > 1024. Fixes #612 and #639 #681

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nemosupremo
Copy link

This PR replaces the usage of select with poll on linux. select has a limitation that the number of descriptors and the actual descriptor value must be lower than FD_SETSIZE which is 1024[1]. The number of descriptor isn't an issue, however if a socket is created that has an FD that is greater than 1024, this will cause libc::FD_SET to panic.

To fix this, instead of using select, we can use poll. poll does not have this limitation. This PR replaces libc::pselect with libc::poll

This fixes #612 and #639.

[1] https://linux-tips.com/t/is-it-possible-to-listen-file-descriptor-greater-than-1024-with-select/45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panicked at 'index out of bounds When using pnet_datalink to send arp request
1 participant