1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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
2 changed files with 7 additions and 0 deletions

View File

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

View File

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