mirror of
https://github.com/golang/go.git
synced 2025-11-08 12:41:02 +00:00
os: add Process.Kill and Process.Signal
R=alex.brainman, r, rsc, krasin, iant, rsc, r CC=golang-dev https://golang.org/cl/4437091
This commit is contained in:
parent
7dd47326e5
commit
94b974a22d
11 changed files with 102 additions and 40 deletions
|
|
@ -45,6 +45,14 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) {
|
|||
return w, nil
|
||||
}
|
||||
|
||||
// Signal sends a signal to the Process.
|
||||
func (p *Process) Signal(sig Signal) Error {
|
||||
if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != 0 {
|
||||
return Errno(e)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Release releases any resources associated with the Process.
|
||||
func (p *Process) Release() Error {
|
||||
// NOOP for unix.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue