003.phpt 846 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. pcntl: SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK
  3. --EXTENSIONS--
  4. pcntl
  5. posix
  6. --SKIPIF--
  7. <?php
  8. if (!function_exists('pcntl_sigwaitinfo') or !function_exists('pcntl_sigtimedwait')) die('skip required functionality is not available');
  9. ?>
  10. --FILE--
  11. <?php
  12. // Clear mask
  13. pcntl_sigprocmask(SIG_SETMASK, array(), $prev);
  14. pcntl_sigprocmask(SIG_BLOCK, array(SIGCHLD,SIGTERM), $old);
  15. var_dump(count($old));
  16. pcntl_sigprocmask(SIG_BLOCK, array(SIGINT), $old);
  17. var_dump(count($old));
  18. pcntl_sigprocmask(SIG_UNBLOCK, array(SIGINT), $old);
  19. var_dump(count($old));
  20. pcntl_sigprocmask(SIG_SETMASK, array(SIGINT), $old);
  21. var_dump(count($old));
  22. pcntl_sigprocmask(SIG_SETMASK, array(), $old);
  23. var_dump(count($old));
  24. // Restore previous mask
  25. pcntl_sigprocmask(SIG_SETMASK, $prev, $old);
  26. var_dump(count($old));
  27. ?>
  28. --EXPECT--
  29. int(0)
  30. int(2)
  31. int(3)
  32. int(2)
  33. int(1)
  34. int(0)