pcntl_signal_get_handler

(PHP 7 >= 7.1.0)

pcntl_signal_get_handlerGet the current handler for specified signal

说明

pcntl_signal_get_handler ( int $signo ) : mixed

The pcntl_signal_get_handler() function will get the current handler for the specified signo.

参数

signo

The signal number.

返回值

This function may return an integer value that refers to SIG_DFL or SIG_IGN. If you set a custom handler a string value containing the function name is returned.

更新日志

版本 说明
7.1.0 pcntl_signal_get_handler() has been added.

范例

Example #1 pcntl_signal_get_handler() example

<?php
var_dump
(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)

function pcntl_test($signo) {}
pcntl_signal(SIGUSR1'pcntl_test');
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: string(10) "pcntl_test"

pcntl_signal(SIGUSR1SIG_DFL);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)

pcntl_signal(SIGUSR1SIG_IGN);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(1)
?>

参见

相关文章
php frontbase 函数 get name of the table the specified field is inphp maxdb 函数 rolls back current transactionphp msql 函数 get the name of the specified field in a resultphp mysqlnd qc 函数 returns information on the current handler the number of cache entries and cache entries if availablephp mysqlnd qc 函数 change current storage handlerphp ncurses 函数 add attributed string with specified length at current positionphp ncurses 函数 add string with specified length at current positionphp ncurses 函数 returns current line kill characterphp ncurses 函数 outputs text at current postion in windowphp ncurses 函数 draws a vertical line in a window at current position using an attributed character and max. n characters longphp openal 函数 make the specified context currentphp openal 函数 process the specified contextphp pcntl 函数 enable/disable asynchronous signal handling or return the old settingphp pcntl 函数 在当前进程当前位置产生分支(子进程)。译注:fork是创建了一个子进程,父进程和子进程 都从fork的位置开始向下继续执行,不同的是父进程执行过程中,得到的fork返回值为子进程 号,而子进程得到的是0。php pcntl 函数 get the current handler for specified signalphp pcntl 函数 检查子进程当前是否已经停止php posix 函数 get the current sid of the processphp ps 函数 draws the current pathphp session pgsql 函数 get current save handler statusphp gmagickdraw applies the specified rotation to the current coordinate space
关注编程学问公众号