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.
Этот коммит содержится в:
родитель
bc098da93f
коммит
db8603e378
1 изменённых файлов: 22 добавлений и 0 удалений
22
src/os/exec_posix.go
Обычный файл
22
src/os/exec_posix.go
Обычный файл
|
@ -0,0 +1,22 @@
|
||||||
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package os
|
||||||
|
|
||||||
|
//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || windows
|
||||||
|
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
// The only signal values guaranteed to be present in the os package on all
|
||||||
|
// systems are os.Interrupt (send the process an interrupt) and os.Kill (force
|
||||||
|
// the process to exit). On Windows, sending os.Interrupt to a process with
|
||||||
|
// os.Process.Signal is not implemented; it will return an error instead of
|
||||||
|
// sending a signal.
|
||||||
|
var (
|
||||||
|
Interrupt Signal = syscall.SIGINT
|
||||||
|
Kill Signal = syscall.SIGKILL
|
||||||
|
)
|
Загрузка…
Создание таблицы
Сослаться в новой задаче