php8.5
Home/ Manual/ posix / functions/ posix_setrlimit

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

resource

The resource limit constant corresponding to the limit that is being set.

soft_limit

The soft limit, in whatever unit the resource limit requires, or POSIX_RLIMIT_INFINITY.

hard_limit

The hard limit, in whatever unit the resource limit requires, or POSIX_RLIMIT_INFINITY.

Return Values

Success

Changelog

VersionDescription
8.5.0Now throws a ValueError when hard_limit or soft_limit is lower than -1, or when soft_limit is greater than hard_limit.

See Also

Source: reference/posix/functions/posix-setrlimit.xml · from the official PHP manual (php/doc-en)