From 92766d3c09039fe3473a5a137fef557e1cd18a76 Mon Sep 17 00:00:00 2001 From: Jorg Sowa Date: Sun, 18 Oct 2026 20:14:29 +0200 Subject: [PATCH] Improve posix_setrlimit() limit error message Co-authored-by: David Carlier --- ext/posix/posix.c | 4 ++-- ext/posix/tests/posix_setrlimit.phpt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/posix/posix.c b/ext/posix/posix.c index f6da93bfe8f3..f217199118db 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -1235,12 +1235,12 @@ PHP_FUNCTION(posix_setrlimit) ZEND_PARSE_PARAMETERS_END(); if (!POSIX_RLIM_VALID(cur)) { - zend_argument_value_error(2, "must be greater or equal to -1"); + zend_argument_value_error(2, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY"); RETURN_THROWS(); } if (!POSIX_RLIM_VALID(max)) { - zend_argument_value_error(3, "must be greater or equal to -1"); + zend_argument_value_error(3, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY"); RETURN_THROWS(); } diff --git a/ext/posix/tests/posix_setrlimit.phpt b/ext/posix/tests/posix_setrlimit.phpt index ea81a944e431..754d68b0ed59 100644 --- a/ext/posix/tests/posix_setrlimit.phpt +++ b/ext/posix/tests/posix_setrlimit.phpt @@ -32,5 +32,5 @@ try { --EXPECT-- bool(true) ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128 -ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1 -ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1 +ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY +ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY