syscall_windows.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package syscall
  2. import (
  3. "fmt"
  4. gosyscall "syscall"
  5. )
  6. // Signal for windows.
  7. // These Signals won't be registered by invoking signal.Notify.
  8. // Use these signal to avoid build error on Windows.
  9. type Signal int
  10. // Signal nothing here
  11. func (s Signal) Signal() {}
  12. func (s Signal) String() string {
  13. return fmt.Sprintf("windows signal %d", int(s))
  14. }
  15. // Signals for windows.
  16. const (
  17. // More invented values for signals
  18. SIGHUP = gosyscall.Signal(0x1)
  19. SIGINT = gosyscall.Signal(0x2)
  20. SIGQUIT = gosyscall.Signal(0x3)
  21. SIGILL = gosyscall.Signal(0x4)
  22. SIGTRAP = gosyscall.Signal(0x5)
  23. SIGABRT = gosyscall.Signal(0x6)
  24. SIGBUS = gosyscall.Signal(0x7)
  25. SIGFPE = gosyscall.Signal(0x8)
  26. SIGKILL = gosyscall.Signal(0x9)
  27. SIGSEGV = gosyscall.Signal(0xb)
  28. SIGPIPE = gosyscall.Signal(0xd)
  29. SIGALRM = gosyscall.Signal(0xe)
  30. SIGTERM = gosyscall.Signal(0xf)
  31. //SIG fake linux signal for windwos.
  32. SIGCHLD = Signal(0x10)
  33. SIGCLD = Signal(0x11)
  34. SIGCONT = Signal(0x12)
  35. SIGIO = Signal(0x13)
  36. SIGIOT = Signal(0x14)
  37. SIGPOLL = Signal(0x15)
  38. SIGPROF = Signal(0x16)
  39. SIGPWR = Signal(0x17)
  40. SIGSTKFLT = Signal(0x18)
  41. SIGSTOP = Signal(0x19)
  42. SIGSYS = Signal(0x1a)
  43. SIGTSTP = Signal(0x1b)
  44. SIGTTIN = Signal(0x1c)
  45. SIGTTOU = Signal(0x1d)
  46. SIGUNUSED = Signal(0x1e)
  47. SIGURG = Signal(0x1f)
  48. SIGUSR1 = Signal(0x20)
  49. SIGUSR2 = Signal(0x21)
  50. SIGVTALRM = Signal(0x22)
  51. SIGWINCH = Signal(0x23)
  52. SIGXCPU = Signal(0x24)
  53. SIGXFSZ = Signal(0x25)
  54. )