aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/os/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/os/exec.go')
-rw-r--r--src/pkg/os/exec.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/pkg/os/exec.go b/src/pkg/os/exec.go
index 6e0f168c76..37a0051c5d 100644
--- a/src/pkg/os/exec.go
+++ b/src/pkg/os/exec.go
@@ -46,11 +46,22 @@ type ProcAttr struct {
Sys *syscall.SysProcAttr
}
-// A Signal can represent any operating system signal.
+// A Signal represents an operating system signal.
+// The usual underlying implementation is operating system-dependent:
+// on Unix it is syscall.Signal.
type Signal interface {
String() string
+ Signal() // to distinguish from other Stringers
}
+// The only signal values guaranteed to be present on all systems
+// are Interrupt (send the process an interrupt) and
+// Kill (force the process to exit).
+var (
+ Interrupt Signal = syscall.SIGINT
+ Kill Signal = syscall.SIGKILL
+)
+
// Getpid returns the process id of the caller.
func Getpid() int { return syscall.Getpid() }