ext/pcntl: pcntl affinity improves EINVAL handling in both cases. (#13907)

also disable tests on travis.
This commit is contained in:
David CARLIER 2024-04-07 16:43:36 +01:00 committed by GitHub
parent 814098248c
commit dd2ffaab2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -1516,6 +1516,9 @@ PHP_FUNCTION(pcntl_getcpuaffinity)
case EPERM: case EPERM:
php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges"); php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges");
break; break;
case EINVAL:
zend_value_error("invalid cpu affinity mask size");
RETURN_THROWS();
default: default:
php_error_docref(NULL, E_WARNING, "Error %d", errno); php_error_docref(NULL, E_WARNING, "Error %d", errno);
} }
@ -1597,6 +1600,9 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
case EPERM: case EPERM:
php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges"); php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges");
break; break;
case EINVAL:
zend_argument_value_error(2, "invalid cpu affinity mask size or unmapped cpu id(s)");
RETURN_THROWS();
default: default:
php_error_docref(NULL, E_WARNING, "Error %d", errno); php_error_docref(NULL, E_WARNING, "Error %d", errno);
} }

View file

@ -5,6 +5,7 @@ pcntl
--SKIPIF-- --SKIPIF--
<?php <?php
if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity is not available"); if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity is not available");
if (getenv('TRAVIS')) die('skip Currently fails on Travis');
?> ?>
--FILE-- --FILE--
<?php <?php