Skip to content

Commit eb32bc5

Browse files
committed
Add os Signal aliases
These are used in Go 1.18's `testing/internal/testdeps`. Though the comment says they should exist _everywhere_, there is still a build constraint, but that seems to be fine.
1 parent 6e233f2 commit eb32bc5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/os/exec_posix.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2009 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package os
6+
7+
//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || windows
8+
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
9+
10+
import (
11+
"syscall"
12+
)
13+
14+
// The only signal values guaranteed to be present in the os package on all
15+
// systems are os.Interrupt (send the process an interrupt) and os.Kill (force
16+
// the process to exit). On Windows, sending os.Interrupt to a process with
17+
// os.Process.Signal is not implemented; it will return an error instead of
18+
// sending a signal.
19+
var (
20+
Interrupt Signal = syscall.SIGINT
21+
Kill Signal = syscall.SIGKILL
22+
)

0 commit comments

Comments
 (0)