Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pinotree
Copy link
Contributor

@pinotree pinotree commented Sep 3, 2020

IOV_MAX is optional in POSIX [1], so it is not defined if the OS does not specify an actual limit. Considering that Lwt_unix.IO_vectors.system_limit already returns int option, then make the C stub return int option directly based on whether IOV_MAX is defined.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html

Potentially now lwt_unix_iov_max could be built also on Windows, removing the if in system_limit; however I don't have a Windows setup to test this, and it can be deferred as a later change anyway.

It is used internally to implement system_limit, which already returns
int option.

There is no behaviour change.
IOV_MAX is optional in POSIX [1], so it is not defined if the OS does
not specify an actual limit. Hence, make lwt_unix_iov_max simply return
None, as it is handled already by the callers.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
@raphael-proust raphael-proust merged commit 50fd7a4 into ocsigen:master Sep 7, 2020
@pinotree pinotree deleted the optional_iov_max branch September 7, 2020 17:27
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