You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
stario/singal_other.go

27 lines
482 B
Go

//go:build !windows
// +build !windows
package stario
import (
"errors"
"os"
"syscall"
)
func signal(sigtype rune) error {
switch sigtype {
case 0x03:
syscall.Kill(os.Getpid(), syscall.SIGINT)
return errors.New("SIGNAL SIGINT RECIVED")
case 0x1a:
syscall.Kill(os.Getpid(), syscall.SIGSTOP)
return errors.New("SIGNAL SIGSTOP RECIVED")
case 0x1c:
syscall.Kill(os.Getpid(), syscall.SIGQUIT)
return errors.New("SIGNAL SIGQUIT RECIVED")
default:
return nil
}
}