File: signal_windows.go

package info (click to toggle)
golang-github-moby-sys 0.0~git20241107.638aa7c-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 616 kB
  • sloc: makefile: 58
file content (57 lines) | stat: -rw-r--r-- 1,827 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package signal

import (
	"syscall"

	"golang.org/x/sys/windows"
)

// Signals used in cli/command (no windows equivalent, use
// invalid signals so they don't get handled)
const (
	SIGCHLD  = syscall.Signal(0xff)
	SIGWINCH = syscall.Signal(0xff)
	SIGPIPE  = syscall.Signal(0xff)
)

// SignalMap is a map of "supported" signals. As per the comment in GOLang's
// ztypes_windows.go: "More invented values for signals". Windows doesn't
// really support signals in any way, shape or form that Unix does.
var SignalMap = map[string]syscall.Signal{
	"ABRT": syscall.Signal(windows.SIGABRT),
	"ALRM": syscall.Signal(windows.SIGALRM),
	"BUS":  syscall.Signal(windows.SIGBUS),
	"FPE":  syscall.Signal(windows.SIGFPE),
	"HUP":  syscall.Signal(windows.SIGHUP),
	"ILL":  syscall.Signal(windows.SIGILL),
	"INT":  syscall.Signal(windows.SIGINT),
	"KILL": syscall.Signal(windows.SIGKILL),
	"PIPE": syscall.Signal(windows.SIGPIPE),
	"QUIT": syscall.Signal(windows.SIGQUIT),
	"SEGV": syscall.Signal(windows.SIGSEGV),
	"TERM": syscall.Signal(windows.SIGTERM),
	"TRAP": syscall.Signal(windows.SIGTRAP),

	// additional linux signals supported for LCOW
	"CHLD":   syscall.Signal(0x11),
	"CLD":    syscall.Signal(0x11),
	"CONT":   syscall.Signal(0x12),
	"IO":     syscall.Signal(0x1d),
	"IOT":    syscall.Signal(0x6),
	"POLL":   syscall.Signal(0x1d),
	"PROF":   syscall.Signal(0x1b),
	"PWR":    syscall.Signal(0x1e),
	"STKFLT": syscall.Signal(0x10),
	"STOP":   syscall.Signal(0x13),
	"SYS":    syscall.Signal(0x1f),
	"TSTP":   syscall.Signal(0x14),
	"TTIN":   syscall.Signal(0x15),
	"TTOU":   syscall.Signal(0x16),
	"URG":    syscall.Signal(0x17),
	"USR1":   syscall.Signal(0xa),
	"USR2":   syscall.Signal(0xc),
	"VTALRM": syscall.Signal(0x1a),
	"WINCH":  syscall.Signal(0x1c),
	"XCPU":   syscall.Signal(0x18),
	"XFSZ":   syscall.Signal(0x19),
}