reboot.h 718 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * Reboot definitions for NOLIBC
  4. * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
  5. */
  6. /* make sure to include all global symbols */
  7. #include "../nolibc.h"
  8. #ifndef _NOLIBC_SYS_REBOOT_H
  9. #define _NOLIBC_SYS_REBOOT_H
  10. #include "../sys.h"
  11. #include <linux/reboot.h>
  12. /*
  13. * int reboot(int cmd);
  14. * <cmd> is among LINUX_REBOOT_CMD_*
  15. */
  16. static __attribute__((unused))
  17. ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg)
  18. {
  19. return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg);
  20. }
  21. static __attribute__((unused))
  22. int reboot(int cmd)
  23. {
  24. return __sysret(sys_reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, NULL));
  25. }
  26. #endif /* _NOLIBC_SYS_REBOOT_H */