Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
Process
/
//opt/alt/ruby21/share/ri/2.1.0/system/Process/kill-c.ri
U:RDoc::AnyMethod[iI" kill:ETI"Process::kill;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"QSends the given signal to the specified process id(s) if _pid_ is positive. ;FI"PIf _pid_ is zero _signal_ is sent to all processes whose group ID is equal ;FI"Qto the group ID of the process. _signal_ may be an integer signal number or ;FI"Qa POSIX signal name (either with or without a +SIG+ prefix). If _signal_ is ;FI"Mnegative (or starts with a minus sign), kills process groups instead of ;FI"?processes. Not all signals are available on all platforms.;Fo:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"pid = fork do ;TI"2 Signal.trap("HUP") { puts "Ouch!"; exit } ;TI" # ... do some work ... ;TI" end ;TI"# ... ;TI"Process.kill("HUP", pid) ;TI"Process.wait ;T:@format0o; ; [I"<em>produces:</em>;F@o;; [I"Ouch! ;T; 0o; ; [ I"5If _signal_ is an integer but wrong for signal, ;FI"@<code>Errno::EINVAL</code> or +RangeError+ will be raised. ;FI"HOtherwise unless _signal_ is a +String+ or a +Symbol+, and a known ;FI"1signal name, +ArgumentError+ will be raised.;F@o; ; [ I"HAlso, <code>Errno::ESRCH</code> or +RangeError+ for invalid _pid_, ;FI"D<code>Errno::EPERM</code> when failed because of no privilege, ;FI"Dwill be raised. In these cases, signals may have been sent to ;FI"preceding processes.;F: @fileI"process.c;T:0@omit_headings_from_table_of_contents_below0I"1Process.kill(signal, pid, ...) -> fixnum ;F0[ I"(*args);T@/FI"Process;TcRDoc::NormalModule00