xref: /PHP-7.1/ext/pcntl/tests/bug73783.phpt (revision b09c2f89)
1--TEST--
2Bug #73783: (SIG_IGN needs to be set to prevent syscals from returning early)
3--SKIPIF--
4<?php
5	if (!extension_loaded('pcntl')) die('skip pcntl extension not available');
6	elseif (!extension_loaded('posix')) die('skip posix extension not available');
7?>
8--FILE--
9<?php
10pcntl_signal(SIGCHLD, SIG_IGN);
11
12switch(pcntl_fork()) {
13    case 0:
14        exit;
15        break;
16}
17
18$before = microtime(true);
19sleep(1);
20
21if (microtime(true) - $before >= 0.8) {
22    echo "working\n";
23} else {
24    echo "failed\n";
25}
26?>
27--EXPECTF--
28working
29