diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-02-12 11:10:55 +0100 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-02-14 15:04:14 +0100 |
commit | 85b7374491e842c44bec3ce5ec800794cae10295 (patch) | |
tree | c45fa8df8796b3741094f796f56b66e9d4388e60 /pkg/signal/signal_unsupported.go | |
parent | 156ce5cd7d6f0f1514d263a74ffe3dd42f7c7caf (diff) | |
download | podman-85b7374491e842c44bec3ce5ec800794cae10295.tar.gz podman-85b7374491e842c44bec3ce5ec800794cae10295.tar.bz2 podman-85b7374491e842c44bec3ce5ec800794cae10295.zip |
add pkg/signal
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>
Diffstat (limited to 'pkg/signal/signal_unsupported.go')
-rw-r--r-- | pkg/signal/signal_unsupported.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkg/signal/signal_unsupported.go b/pkg/signal/signal_unsupported.go new file mode 100644 index 000000000..0a92a5b3a --- /dev/null +++ b/pkg/signal/signal_unsupported.go @@ -0,0 +1,28 @@ +// +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") +} |