diff options
Diffstat (limited to 'libgo/go/os/exec_unix.go')
-rw-r--r-- | libgo/go/os/exec_unix.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libgo/go/os/exec_unix.go b/libgo/go/os/exec_unix.go index 8990d6a..8a4b2e1 100644 --- a/libgo/go/os/exec_unix.go +++ b/libgo/go/os/exec_unix.go @@ -38,6 +38,9 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) { if e != 0 { return nil, NewSyscallError("wait", e) } + if options&WSTOPPED == 0 { + p.done = true + } w = new(Waitmsg) w.Pid = pid1 w.WaitStatus = status @@ -45,6 +48,17 @@ 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 p.done { + return NewError("os: process already finished") + } + 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. |