Skip to content

Handle an optional IOV_MAX - #801

Merged
raphael-proust merged 2 commits into
ocsigen:masterfrom
pinotree:optional_iov_max
Sep 7, 2020
Merged

raphael-proust merged 2 commits into
ocsigen:masterfrom
pinotree:optional_iov_max

Conversation

@pinotree

@pinotree pinotree commented Sep 3, 2020

Copy link
Copy Markdown
Contributor

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