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:
Evan Shaw 2011-06-06 19:53:30 +10:00 committed by Rob Pike
parent 7dd47326e5
commit 94b974a22d
11 changed files with 102 additions and 40 deletions

View file

@ -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.