reboot.go 518 B

123456789101112131415161718192021
  1. // reboot.go
  2. // compile errors (Windows):
  3. //undefined: syscall.SYS_REBOOT
  4. // reboot.go:13: not enough arguments in call to syscall.Syscall
  5. // Linux: compileert, uitvoeren met sudo ./6.out --> systeem herstart
  6. package main
  7. import (
  8. "syscall"
  9. )
  10. const LINUX_REBOOT_MAGIC1 uintptr = 0xfee1dead
  11. const LINUX_REBOOT_MAGIC2 uintptr = 672274793
  12. const LINUX_REBOOT_CMD_RESTART uintptr = 0x1234567
  13. func main() {
  14. syscall.Syscall(syscall.SYS_REBOOT,
  15. LINUX_REBOOT_MAGIC1,
  16. LINUX_REBOOT_MAGIC2,
  17. LINUX_REBOOT_CMD_RESTART)
  18. }