generated from ContainerSSH/library-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
signal_windows.go
41 lines (38 loc) · 905 Bytes
/
signal_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// +build windows
package main
import (
"fmt"
"os"
"syscall"
)
// processSignalName creates an os.Signal from the specified name from RFC 4254 Section 6.9
// ( https://tools.ietf.org/html/rfc4254#section-6.9 ) or returns an error if the name is not supported on the
// platform.
func processSignalName(name string) (os.Signal, error) {
switch name {
case "ABRT":
return syscall.SIGABRT, nil
case "ALRM":
return syscall.SIGALRM, nil
case "FPE":
return syscall.SIGFPE, nil
case "HUP":
return syscall.SIGHUP, nil
case "ILL":
return syscall.SIGILL, nil
case "INT":
return syscall.SIGINT, nil
case "KILL":
return syscall.SIGKILL, nil
case "PIPE":
return syscall.SIGPIPE, nil
case "QUIT":
return syscall.SIGQUIT, nil
case "SEGV":
return syscall.SIGSEGV, nil
case "TERM":
return syscall.SIGTERM, nil
default:
return nil, fmt.Errorf("unsupported signal: %s", name)
}
}