-
Notifications
You must be signed in to change notification settings - Fork 681
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
nix::sys::resource::getrlimit doesn't actually return None #1666
Comments
Good catch. Care to submit a PR to fix it? |
What do you want the fix to be? Just fix the documentation? Or change the two functions to remove the Options entirely? |
Probably should remove |
bors bot
added a commit
that referenced
this issue
Mar 14, 2022
1668: Change getrlimit and setrlimit to use rlim_t directly. r=asomers a=Arnavion Fixes #1666 Co-authored-by: Arnavion <[email protected]>
bors bot
added a commit
that referenced
this issue
Mar 14, 2022
1668: Change getrlimit and setrlimit to use rlim_t directly. r=asomers a=Arnavion Fixes #1666 Co-authored-by: Arnavion <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Documentation says:
nix/src/sys/resource.rs
Lines 176 to 177 in 6123083
but code unconditionally returns
Some()
:nix/src/sys/resource.rs
Lines 209 to 212 in 6123083
This documentation is leftover from the old PR code which did return
None
:... but the new PR removed that branch.
It would be nice to not return
Option
fromgetrlimit
at least, since it makes the caller code more annoying when we only want to callsetrlimit
when we need to, which requires comparing the returned soft limit vs the returned hard limit. And ifgetrlimit
is changed to not special-caseINFINITY
, the special-case might as well be removed fromsetrlimit
too so that one doesn't need toSome()
-wrap the values when passing them fromgetrlimit
tosetrlimit
.The text was updated successfully, but these errors were encountered: