Browse code

Windows: Enable kill (part one)

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/10/13 06:32:59
Showing 2 changed files
... ...
@@ -1,4 +1,4 @@
1
-// +build !linux,!darwin,!freebsd
1
+// +build !linux,!darwin,!freebsd,!windows
2 2
 
3 3
 package signal
4 4
 
... ...
@@ -14,3 +14,14 @@ const (
14 14
 	// DefaultStopSignal is the syscall signal used to stop a container in windows systems.
15 15
 	DefaultStopSignal = "15"
16 16
 )
17
+
18
+// SignalMap is a map of "supported" signals. As per the comment in GOLang's
19
+// ztypes_windows.go: "More invented values for signals". Windows doesn't
20
+// really support signals in any way, shape or form that Unix does.
21
+//
22
+// We have these so that docker kill can be used to gracefully (TERM) and
23
+// forcibly (KILL) terminate a container on Windows.
24
+var SignalMap = map[string]syscall.Signal{
25
+	"KILL": syscall.SIGKILL,
26
+	"TERM": syscall.SIGTERM,
27
+}