From f07efc21c29d926699524f101c130b87e85cf999 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 18 Oct 2026 14:58:12 +0100 Subject: [PATCH 1/4] ext/standard: skip proc_open descriptor 0 tests on Solaris. The tests check which file descriptor 0 points to by calling readlink() on /proc/self/fd/0. On Solaris/illumos the entries in /proc/self/fd are not symlinks, so readlink() fails with EINVAL and the tests fail. --- .../proc_open_descriptor_0_setup_failure.phpt | 3 +++ .../proc_open_socket_descriptor_0_setup_failure.phpt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt b/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt index ea654b0f497a..9a515136cac4 100644 --- a/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt +++ b/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt @@ -8,6 +8,9 @@ if (!function_exists("proc_open")) { if (!@is_dir("/proc/self/fd")) { die("skip requires /proc/self/fd"); } +if (PHP_OS_FAMILY === "Solaris") { + die("skip /proc/self/fd entries are not symlinks on Solaris"); +} ?> --FILE-- --FILE-- Date: Sun, 18 Oct 2026 15:51:09 +0100 Subject: [PATCH 2/4] trigger build From 6cda542ddc9a061ac022a3bd2919257507ff6a4d Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 18 Oct 2026 16:19:42 +0100 Subject: [PATCH 3/4] ext/posix: accept POSIX_RLIMIT_INFINITY in posix_setrlimit() on Solaris. RLIM_INFINITY is (rlim_t)-3 there, rejected by the >= -1 range check. --- ext/posix/posix.c | 8 ++++---- ext/posix/tests/posix_setrlimit.phpt | 4 ++-- ext/posix/tests/posix_setrlimit_infinity.phpt | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 ext/posix/tests/posix_setrlimit_infinity.phpt diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 049d0bfdf19c..226c2fe01f75 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -1227,13 +1227,13 @@ PHP_FUNCTION(posix_setrlimit) Z_PARAM_LONG(max) ZEND_PARSE_PARAMETERS_END(); - if (cur < -1) { - zend_argument_value_error(2, "must be greater or equal to -1"); + if (cur < -1 && cur != (zend_long) RLIM_INFINITY) { + zend_argument_value_error(2, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY"); RETURN_THROWS(); } - if (max < -1) { - zend_argument_value_error(3, "must be greater or equal to -1"); + if (max < -1 && max != (zend_long) RLIM_INFINITY) { + 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 diff --git a/ext/posix/tests/posix_setrlimit_infinity.phpt b/ext/posix/tests/posix_setrlimit_infinity.phpt new file mode 100644 index 000000000000..3fb4ad5ec135 --- /dev/null +++ b/ext/posix/tests/posix_setrlimit_infinity.phpt @@ -0,0 +1,14 @@ +--TEST-- +posix_setrlimit(): accepts POSIX_RLIMIT_INFINITY +--EXTENSIONS-- +posix +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) From 56c0efc67cefb577375fd5c77cc85b868bfda269 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 18 Oct 2026 16:19:43 +0100 Subject: [PATCH 4/4] ext/session: skip session_write_close_encode_failure.phpt on Solaris. flock() is emulated with per-process fcntl() locks there. --- ext/session/tests/session_write_close_encode_failure.phpt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/session/tests/session_write_close_encode_failure.phpt b/ext/session/tests/session_write_close_encode_failure.phpt index 1c562f401df2..e07cfc9c42e2 100644 --- a/ext/session/tests/session_write_close_encode_failure.phpt +++ b/ext/session/tests/session_write_close_encode_failure.phpt @@ -3,7 +3,12 @@ session_write_close() closes the save handler when encoding the session data fai --EXTENSIONS-- session --SKIPIF-- - + --INI-- session.use_cookies=0 session.cache_limiter=