xref: /PHP-7.1/ext/pcntl/tests/003.phpt (revision fe9ce624)
1--TEST--
2pcntl: SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK
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	elseif (!function_exists('pcntl_sigwaitinfo') or !function_exists('pcntl_sigtimedwait')) die('skip required functionality is not available');
8?>
9--FILE--
10<?php
11
12pcntl_sigprocmask(SIG_BLOCK, array(SIGCHLD,SIGTERM), $old);
13var_dump(count($old));
14pcntl_sigprocmask(SIG_BLOCK, array(SIGINT), $old);
15var_dump(count($old));
16pcntl_sigprocmask(SIG_UNBLOCK, array(SIGINT), $old);
17var_dump(count($old));
18pcntl_sigprocmask(SIG_SETMASK, array(SIGINT), $old);
19var_dump(count($old));
20pcntl_sigprocmask(SIG_SETMASK, array(), $old);
21var_dump(count($old));
22pcntl_sigprocmask(SIG_SETMASK, array(), $old);
23var_dump(count($old));
24
25?>
26--EXPECT--
27int(0)
28int(2)
29int(3)
30int(2)
31int(1)
32int(0)
33