1--TEST--
2pcntl_setns()
3--EXTENSIONS--
4pcntl
5posix
6--SKIPIF--
7<?php
8if (!function_exists("pcntl_setns")) die("skip pcntl_setns is not available");
9if (getenv('SKIP_ASAN')) die('skip Timeouts under ASAN');
10
11$pid = pcntl_fork();
12if ($pid == -1) die("skip pcntl_fork failed");
13if ($pid != 0) {
14    if (@pcntl_setns($pid, CLONE_NEWPID) === false && pcntl_get_last_error() == PCNTL_EPERM) {
15        die("skip Insufficient privileges to use pcntl_setns()");
16    }
17}
18?>
19--FILE--
20<?php
21$pid = pcntl_fork();
22if ($pid == -1) die("pcntl_fork failed");
23if ($pid != 0) {
24	var_dump(pcntl_setns($pid, CLONE_NEWPID));
25}
26?>
27--EXPECT--
28bool(true)
29