加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – Windows上有哪些Process.kill信号?

发布时间:2020-12-16 19:25:37 所属栏目:百科 来源:网络整理
导读:从 Process.kill 的文档: Sends the given signal to the specified process id(s) if pid is positive. If pid is zero signal is sent to all processes whose group ID is equal to the group ID of the process. signal may be an integer signal numbe
Process.kill的文档:

Sends the given signal to the specified process id(s) if pid is
positive. If pid is zero signal is sent to all processes whose group
ID is equal to the group ID of the process. signal may be an integer
signal number or a POSIX signal name (either with or without a SIG
prefix). If signal is negative (or starts with a minus sign),kills
process groups instead of processes. Not all signals are available
on all platforms.

好的,那很模糊.在哪些平台上可以获得哪些信号? Windows上是否有可用的信号?

(我之前在Windows上尝试过Process.kill(9,pid)并且它没有抛出错误.虽然它没有杀死进程…但是Process.kill(“TERM”,pid)确实抛出错误. 去搞清楚.)

解决方法

我想我找到了解决方案.要找出当前平台支持的信号,请运行以下命令:
ruby -e "puts Signal.list"

在Windows上:

{"EXIT"=>0,"INT"=>2,"ILL"=>4,"ABRT"=>22,"FPE"=>8,"KILL"=>9,"SEGV"=>11,"TERM"=>15}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读