gpt4 book ai didi

PHP/Linux : Does 'kill -9' equate to SIGKILL?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:45:39 25 4
gpt4 key购买 nike

<分区>

我正在查看这个用于执行信号陷阱的 PHP 代码:

<?php
/*
SIGTERM for 'kill' default of -15
SIGINT for control-c
*/
declare(ticks = 1);

pcntl_signal(SIGTERM, "signal_handler");
pcntl_signal(SIGINT, "signal_handler");

function signal_handler($signal) {
switch($signal) {
case SIGTERM:
print "Caught SIGTERM\n";
exit;
case SIGKILL:
print "Caught SIGKILL\n";
exit;
case SIGINT:
print "Caught SIGINT\n";
exit;
}
}

while(1) {
//
}
?>

SIGKILL 是否可以等同于“kill”命令(例如“kill -9”)的数字选项?如果不是,什么条件会导致 SIGKILL 信号?谢谢!

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com