github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/signal/signal_unsupported.go (about) 1 // +build !linux 2 3 // Signal handling for Linux only. 4 package signal 5 6 import ( 7 "fmt" 8 "os" 9 "syscall" 10 ) 11 12 const SIGWINCH = syscall.Signal(0xff) 13 14 // ParseSignal translates a string to a valid syscall signal. 15 // It returns an error if the signal map doesn't include the given signal. 16 func ParseSignal(rawSignal string) (syscall.Signal, error) { 17 return 0, fmt.Errorf("unsupported on non-linux platforms") 18 } 19 20 // CatchAll catches all signals and relays them to the specified channel. 21 func CatchAll(sigc chan os.Signal) { 22 panic("Unsupported on non-linux platforms") 23 } 24 25 // StopCatch stops catching the signals and closes the specified channel. 26 func StopCatch(sigc chan os.Signal) { 27 panic("Unsupported on non-linux platforms") 28 } 29 30 // ParseSignalNameOrNumber translates a string to a valid syscall signal. Input 31 // can be a name or number representation i.e. "KILL" "9" 32 func ParseSignalNameOrNumber(rawSignal string) (syscall.Signal, error) { 33 return 0, fmt.Errorf("unsupported on non-linux platforms") 34 }