Annotation of embedaddon/php/ext/pcntl/tests/pcntl_signal_dispatch.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: pcnt_signal_dispatch()
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("pcntl")) print "skip";
! 6: elseif (!function_exists("pcntl_signal")) print "skip pcntl_signal() not available";
! 7: elseif (!function_exists("pcntl_signal_dispatch")) print "skip pcntl_signal_dispatch() not available";
! 8: elseif (!function_exists("posix_kill")) print "skip posix_kill() not available";
! 9: elseif (!function_exists("posix_getpid")) print "skip posix_getpid() not available";
! 10: ?>
! 11: --FILE--
! 12: <?php
! 13:
! 14: pcntl_signal(SIGTERM, function ($signo) { echo "Signal handler called!\n"; });
! 15:
! 16: echo "Start!\n";
! 17: posix_kill(posix_getpid(), SIGTERM);
! 18: $i = 0; // dummy
! 19: pcntl_signal_dispatch();
! 20: echo "Done!\n";
! 21:
! 22: ?>
! 23: --EXPECTF--
! 24: Start!
! 25: Signal handler called!
! 26: Done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>