|
The pcntl_signal() function installs a new signal handler for the signal indicated by signo. The signal handler is set to handler which may be the name of a user created function, or either of the two global constants SIG_IGN or SIG_DFL. The optional restart_syscalls specifies whether system call restarting should be used when this signal arrives and defaults to TRUE.
Zwraca TRUE w przypadku sukcesu, FALSE w przypadku porażki.
Notatka: The optional restart_syscalls parameter became available in PHP 4.3.0.
Notatka: The ability to use an object method as a callback became available in PHP 4.3.0. Note that when you set a handler to an object method, that object's reference count is increased which makes it persist until you either change the handler to something else, or your script ends.
Notatka: As of PHP 4.3.0 PCNTL uses ticks as the signal handle callback mechanism, which is much faster than the previous mechanism. This change follows the same semantics as using "user ticks". You must use the declare() statement to specify the locations in your program where callbacks are allowed to occur for the signal handler to function properly (as used in the above example).
See also pcntl_fork() and pcntl_waitpid().
Poprzedni | Spis treści | Następny |
pcntl_setpriority | Początek rozdziału | pcntl_wait |
Hosting by: Hurra Communications Sp. z o.o.
Generated: 2007-01-26 18:02:53