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

前端之家收集整理的这篇文章主要介绍了ruby – Windows上有哪些Process.kill信号?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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}
原文链接:https://www.f2er.com/ruby/270960.html

猜你在找的Ruby相关文章