mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00

Add pkg/signal to deal with parts of signal processing and translating signals from string to numeric representations. The code has been copied from docker/docker (and attributed with the copyright) but been reduced to only what libpod needs (on Linux). Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
29 lines
723 B
Go
29 lines
723 B
Go
// +build !linux
|
|
|
|
// Signal handling for Linux only.
|
|
package signal
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
const SIGWINCH = syscall.Signal(0xff)
|
|
|
|
// ParseSignal translates a string to a valid syscall signal.
|
|
// It returns an error if the signal map doesn't include the given signal.
|
|
func ParseSignal(rawSignal string) (syscall.Signal, error) {
|
|
return 0, fmt.Errorf("unsupported on non-linux platforms")
|
|
}
|
|
|
|
// CatchAll catches all signals and relays them to the specified channel.
|
|
func CatchAll(sigc chan os.Signal) {
|
|
panic("Unsupported on non-linux platforms")
|
|
}
|
|
|
|
// StopCatch stops catching the signals and closes the specified channel.
|
|
func StopCatch(sigc chan os.Signal) {
|
|
panic("Unsupported on non-linux platforms")
|
|
}
|