Skip to content

Commit dd2ffaa

Browse files
authored
ext/pcntl: pcntl affinity improves EINVAL handling in both cases. (php#13907)
also disable tests on travis.
1 parent 8140982 commit dd2ffaa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ext/pcntl/pcntl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,9 @@ PHP_FUNCTION(pcntl_getcpuaffinity)
15161516
case EPERM:
15171517
php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges");
15181518
break;
1519+
case EINVAL:
1520+
zend_value_error("invalid cpu affinity mask size");
1521+
RETURN_THROWS();
15191522
default:
15201523
php_error_docref(NULL, E_WARNING, "Error %d", errno);
15211524
}
@@ -1597,6 +1600,9 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
15971600
case EPERM:
15981601
php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges");
15991602
break;
1603+
case EINVAL:
1604+
zend_argument_value_error(2, "invalid cpu affinity mask size or unmapped cpu id(s)");
1605+
RETURN_THROWS();
16001606
default:
16011607
php_error_docref(NULL, E_WARNING, "Error %d", errno);
16021608
}

ext/pcntl/tests/pcntl_cpuaffinity.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pcntl
55
--SKIPIF--
66
<?php
77
if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity is not available");
8+
if (getenv('TRAVIS')) die('skip Currently fails on Travis');
89
?>
910
--FILE--
1011
<?php

0 commit comments

Comments
 (0)