Skip to content

Fix for issue #488: ensure that the number of iovec entries does not exceed __IOV_MAX. #489

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

Merged
merged 2 commits into from
Oct 23, 2022

Conversation

dreibh
Copy link
Contributor

@dreibh dreibh commented Oct 18, 2022

Fix for issue #488: ensure that the number of iovec entries does not exceed __IOV_MAX.

@gvanem
Copy link
Contributor

gvanem commented Oct 19, 2022

This is Linux specific. On Windows, I get:

src/lib/ares_process.c(259,23): error: use of undeclared identifier '__IOV_MAX'
              if(n >= __IOV_MAX)
                      ^

@dreibh
Copy link
Contributor Author

dreibh commented Oct 19, 2022

Indeed, this was not platform-independent. It also failed on FreeBSD. I have no Windows system for testing.

I updated the code, according to the documentation in the writev() manpage. IOV_MAX is used on FreeBSD, on modern Linux the limit is from sysconf(_SC_IOV_MAX), on very old Linux it is 16. The default of 16 is also used by the BOOST libraries, in case of IOV_MAX and sysconf(_SC_IOV_MAX) not being possible.

@bradh352 bradh352 merged commit 3400e07 into c-ares:main Oct 23, 2022
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.

3 participants