From 1a70eff904944dde32213a27d3357c7380067fd0 Mon Sep 17 00:00:00 2001 From: r0cky <44518337+r0ckysec@users.noreply.github.com> Date: Tue, 8 Mar 2022 16:18:50 +0800 Subject: [PATCH] fix SIGUSR1 signal incompatible windows bug. xxx.go:64:3: undefined: syscall.SIGUSR1 xxx.go:65:3: undefined: syscall.SIGUSR2 xxx.go:68:3: undefined: syscall.SIGTSTP xxx.go:111:5: undefined: syscall.SIGUSR1 xxx.go:112:5: undefined: syscall.SIGUSR2 xxx.go:115:5: undefined: syscall.SIGTSTP xxx.go:119:5: undefined: syscall.SIGUSR1 xxx.go:120:5: undefined: syscall.SIGUSR2 xxx.go:123:5: undefined: syscall.SIGTSTP xxx.go:224:3: undefined: syscall.Kill xxx.go:224:3: too many errors after fixing, it can be compiled normally The items in question are: https://github.com/fvbock/endless/issues/30 --- src/syscall/types_windows.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/syscall/types_windows.go b/src/syscall/types_windows.go index 384b5b4f2c1f6..a8a06d894e500 100644 --- a/src/syscall/types_windows.go +++ b/src/syscall/types_windows.go @@ -80,8 +80,24 @@ var signals = [...]string{ 13: "broken pipe", 14: "alarm clock", 15: "terminated", + /* compatible with windows */ + 16: "SIGUSR1", + 17: "SIGUSR2", + 18: "SIGTSTP", + /* compatible with windows */ } +/* compatible with windows */ +func Kill(...interface{}) error { + return nil; +} +const ( + SIGUSR1 = Signal(16) + SIGUSR2 = Signal(17) + SIGTSTP = Signal(18) +) +/* compatible with windows */ + const ( GENERIC_READ = 0x80000000 GENERIC_WRITE = 0x40000000