package signal
import "github.com/moby/sys/signal"
Package signal provides helper functions for dealing with signals across various operating systems.
Index ¶
- Constants
- Variables
- func CatchAll(sigc chan os.Signal)
- func ParseSignal(rawSignal string) (syscall.Signal, error)
- func StopCatch(sigc chan os.Signal)
- func ValidSignalForPlatform(sig syscall.Signal) bool
Constants ¶
const ( // SIGCHLD is a signal sent to a process when a child process terminates, is interrupted, or resumes after being interrupted. SIGCHLD = syscall.SIGCHLD // SIGWINCH is a signal sent to a process when its controlling terminal changes its size SIGWINCH = syscall.SIGWINCH // SIGPIPE is a signal sent to a process when a pipe is written to before the other end is open for reading SIGPIPE = syscall.SIGPIPE )
Variables ¶
SignalMap is an empty map of signals for unsupported platform.
Functions ¶
func CatchAll ¶
CatchAll catches all signals and relays them to the specified channel. SIGURG is not handled, as it's used by the Go runtime to support preemptable system calls.
func ParseSignal ¶
ParseSignal translates a string to a valid syscall signal. It returns an error if the signal map doesn't include the given signal.
func StopCatch ¶
StopCatch stops catching the signals and closes the specified channel.
func ValidSignalForPlatform ¶
ValidSignalForPlatform returns true if a signal is valid on the platform
Source Files ¶
signal.go signal_unix.go signal_unsupported.go
- Version
- v0.7.1 (latest)
- Published
- Jul 16, 2024
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 1 month ago –
Tools for package owners.