package signal

import "github.com/docker/docker/pkg/signal"

Package signal provides helper functions for dealing with signals across various operating systems.

Index

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
	// DefaultStopSignal is the syscall signal used to stop a container in unix systems.
	DefaultStopSignal = "SIGTERM"
)

Variables

var SignalMap = map[string]syscall.Signal{}

SignalMap is an empty map of signals for unsupported platform.

Functions

func CatchAll

func CatchAll(sigc chan os.Signal)

CatchAll catches all signals and relays them to the specified channel.

func DumpStacks

func DumpStacks()

DumpStacks dumps the runtime stack.

func ParseSignal

func ParseSignal(rawSignal string) (syscall.Signal, error)

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

func StopCatch(sigc chan os.Signal)

StopCatch stops catching the signals and closes the specified channel.

func Trap

func Trap(cleanup func())

Trap sets up a simplified signal "trap", appropriate for common behavior expected from a vanilla unix command-line tool in general (and the Docker engine in particular).

func ValidSignalForPlatform

func ValidSignalForPlatform(sig syscall.Signal) bool

ValidSignalForPlatform returns true if a signal is valid on the platform

Source Files

signal.go signal_unix.go signal_unsupported.go trap.go

Version
v1.12.0-rc4
Published
Jul 13, 2016
Platform
js/wasm
Imports
9 packages
Last checked
17 minutes ago

Tools for package owners.