unix processes and signals work) but:
```
package main
import (
"fmt"
"os/exec"
"syscall"
)
func main() {
cmd := exec.Command("sleep", "1000000")
cmd.Start()
done := make(chan struct{})
go func() {
err := cmd.Wait()
exitStatus := cmd.ProcessState.Sys().(syscall.WaitStatus).ExitStatus()
fmt.Println("Error:", err)
fmt.Println("Status:", exitStatus)
close(done)
}()
cmd.Process.Kill()
<-done
}
```
Outputs:
Error: signal: killed
Status: -1
Looking at ExitStatus here
(http://golang.org/src/pkg/syscall/syscall_linux.go?s=4510:4546#L180) I see
that -1 implies the process has not exited. But it actually has (I checked
with `ps`)!
Is this a bug, or desired behavior? When I run `sleep 1000000` in a shell
and then send said process the KILL signal I get an exit code of 137 which
is consistent with http://www.tldp.org/LDP/abs/html/exitcodes.html
Thanks!
Onsi
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.