posix_setrlimit
PHP function
Edit on GitHub ✎
(PHP 7, PHP 8)
Set system resource limits
Description
posix_setrlimit(int $resource, int $soft_limit, int $hard_limit): bool
posix_setrlimit() sets the soft and hard limits for a given system resource.
Rlimits
Parameters
resourceThe resource limit constant corresponding to the limit that is being set.
soft_limitThe soft limit, in whatever unit the resource limit requires, or
POSIX_RLIMIT_INFINITY.hard_limitThe hard limit, in whatever unit the resource limit requires, or
POSIX_RLIMIT_INFINITY.
Return Values
Success
Changelog
| Version | Description |
|---|---|
| 8.5.0 | Now throws a ValueError when hard_limit or soft_limit is lower than -1, or when soft_limit is greater than hard_limit. |
See Also
- man page SETRLIMIT(2)
posix_getrlimit()