Download src/php/php-src/ext/pcntl/tests/pcntl_setns_basic.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pcntl/tests/pcntl_setns_basic.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pcntl/tests/pcntl_setns_basic.phpt
-
curl -L -o pcntl_setns_basic.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pcntl/tests/pcntl_setns_basic.phpt
725 Bytes
| --TEST-- | |
| pcntl_setns() | |
| --EXTENSIONS-- | |
| pcntl | |
| posix | |
| --SKIPIF-- | |
| if (!function_exists("pcntl_setns")) die("skip pcntl_setns is not available"); | |
| if (getenv('SKIP_ASAN')) die('skip Timeouts under ASAN'); | |
| $pid = pcntl_fork(); | |
| if ($pid == -1) die("skip pcntl_fork failed"); | |
| if ($pid != 0) { | |
| if (@pcntl_setns($pid, CLONE_NEWPID) === false && pcntl_get_last_error() == PCNTL_EPERM) { | |
| die("skip Insufficient privileges to use pcntl_setns()"); | |
| } | |
| } | |
| --FILE-- | |
| $pid = pcntl_fork(); | |
| if ($pid == -1) die("pcntl_fork failed"); | |
| if ($pid != 0) { | |
| try { | |
| pcntl_setns($pid, 0); | |
| } catch (\ValueError $e) { | |
| echo $e->getMessage(); | |
| } | |
| } | |
| --EXPECTF-- | |
| pcntl_setns(): Argument #2 ($nstype) is an invalid nstype (%d) | |