[php-src] master: Merge branch 'PHP-8.6'

From: Date: Sun, 18 Oct 2026 18:10:47 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142420@lists.php.net to get a copy of this message
Author: Jorg Sowa (jorgsowa) Date: 2026-10-18T20:09:21+02:00 Commit: https://github.com/php/php-src/commit/0ae187de16fe7e2156b4648b6f47251da6c304b6 Raw diff: https://github.com/php/php-src/commit/0ae187de16fe7e2156b4648b6f47251da6c304b6.diff Merge branch 'PHP-8.6' Changed paths: M ext/posix/posix.c Diff: diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 049d0bfdf19c..f6da93bfe8f3 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -1215,7 +1215,14 @@ PHP_FUNCTION(posix_getrlimit) #endif /* HAVE_GETRLIMIT */ #ifdef HAVE_SETRLIMIT -/* {{{ Set system resource consumption limits (POSIX.1-2001) */ +/* Solaris defines RLIM_INFINITY as (rlim_t)-3, so POSIX_RLIMIT_INFINITY is below -1 */ +#ifdef __sun +# define POSIX_RLIM_VALID(v) ((v) >= -1 || (v) == (zend_long) RLIM_INFINITY) +#else +# define POSIX_RLIM_VALID(v) ((v) >= -1) +#endif + +/* Set system resource consumption limits (POSIX.1-2001) */ PHP_FUNCTION(posix_setrlimit) { struct rlimit rl; @@ -1227,12 +1234,12 @@ PHP_FUNCTION(posix_setrlimit) Z_PARAM_LONG(max) ZEND_PARSE_PARAMETERS_END(); - if (cur < -1) { + if (!POSIX_RLIM_VALID(cur)) { zend_argument_value_error(2, "must be greater or equal to -1"); RETURN_THROWS(); } - if (max < -1) { + if (!POSIX_RLIM_VALID(max)) { zend_argument_value_error(3, "must be greater or equal to -1"); RETURN_THROWS(); } @@ -1252,7 +1259,6 @@ PHP_FUNCTION(posix_setrlimit) RETURN_TRUE; } -/* }}} */ #endif /* HAVE_SETRLIMIT */

« previous php.cvs (#142420) next »