Source File
signal_unix.go
Belonging Package
os/signal
// Copyright 2012 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.
//go:build unix || (js && wasm) || wasip1 || windows
package signal
import (
)
// Defined by the runtime package.
func signal_disable(uint32)
func signal_enable(uint32)
func signal_ignore(uint32)
func signal_ignored(uint32) bool
func signal_recv() uint32
func loop() {
for {
process(syscall.Signal(signal_recv()))
}
}
func init() {
watchSignalLoop = loop
}
const (
numSig = 65 // max across all systems
)
func signum( os.Signal) int {
switch sig := .(type) {
case syscall.Signal:
:= int()
if < 0 || >= numSig {
return -1
}
return
default:
return -1
}
}
func enableSignal( int) {
signal_enable(uint32())
}
func disableSignal( int) {
signal_disable(uint32())
}
func ignoreSignal( int) {
signal_ignore(uint32())
}
func signalIgnored( int) bool {
return signal_ignored(uint32())
}
The pages are generated with Golds v0.6.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |