-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow specifying resource in posix_getrlimit() for single result #9790
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
Conversation
8c9c382
to
5fbe6e9
Compare
5fbe6e9
to
f1a6592
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a useful feature to me. I'm not quite sure, though, about the "unlimited"
return value; while that matches what we have so far, yielding null
might be more reasonable (after all, there is no limit).
@cmb69 I've thought about this as well and thought it might be better to stay consistent in terms of values returned. Returning two distinct values for unlimited within the same function might be a bit of a WTF. If we do use a different value it might make more sense to return If we really want to do that, I think it might be better to introduce a new function altogether. |
Any ideas for a new function name? |
I don't think a new function is necessary (my reaction was because you're reasoning to just return |
@cmb69 Do you think this needs a mail to the internals? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this needs a mail to the internals?
No. But it needs an entry in UPGRADING. :)
Fetching all resource limits seems incredibly wasteful, and the API also becomes more awkward (
posix_getrlimit()['soft core']
). This PR allows specifying a resource, returning[$softLimit, $hardLimit]
that can be destructured.