summaryrefslogtreecommitdiff
path: root/ext/pcntl/tests
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-12-29 21:18:58 +0100
committerNikita Popov <nikic@php.net>2016-12-29 21:18:58 +0100
commit270f1ffd19bccf799ece32ce136842edd69a333a (patch)
tree991f074f05b39bf1b31fd6eeaa503946d3dc3203 /ext/pcntl/tests
parent30029d137f17573c530fbd56f93e0a268eb177b1 (diff)
parentb09c2f899ebc14029d0936d770cced10b607f84b (diff)
downloadphp-git-270f1ffd19bccf799ece32ce136842edd69a333a.tar.gz
Merge branch 'PHP-7.1'
Diffstat (limited to 'ext/pcntl/tests')
-rw-r--r--ext/pcntl/tests/bug73783.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/pcntl/tests/bug73783.phpt b/ext/pcntl/tests/bug73783.phpt
new file mode 100644
index 0000000000..beacdf6b8d
--- /dev/null
+++ b/ext/pcntl/tests/bug73783.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #73783: (SIG_IGN needs to be set to prevent syscals from returning early)
+--SKIPIF--
+<?php
+ if (!extension_loaded('pcntl')) die('skip pcntl extension not available');
+ elseif (!extension_loaded('posix')) die('skip posix extension not available');
+?>
+--FILE--
+<?php
+pcntl_signal(SIGCHLD, SIG_IGN);
+
+switch(pcntl_fork()) {
+ case 0:
+ exit;
+ break;
+}
+
+$before = microtime(true);
+sleep(1);
+
+if (microtime(true) - $before >= 0.8) {
+ echo "working\n";
+} else {
+ echo "failed\n";
+}
+?>
+--EXPECTF--
+working