From 788aca91ab5e4cccae158aac03a1d653c6da2fde Mon Sep 17 00:00:00 2001 From: Zhangjin Wu Date: Sat, 8 Jul 2023 02:29:30 +0800 Subject: [PATCH] tools/nolibc: types.h: add RB_ flags for reboot() Both glibc and musl provide RB_ flags via for reboot(), they don't need to include , let nolibc provide RB_ flags too. Signed-off-by: Zhangjin Wu Signed-off-by: Willy Tarreau --- tools/include/nolibc/sys.h | 1 - tools/include/nolibc/types.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 61a3204b00d7b..804bc0231ec7e 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -21,7 +21,6 @@ #include #include /* for O_* and AT_* */ #include /* for statx() */ -#include /* for LINUX_REBOOT_* */ #include #include "arch.h" diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 5e1bac8509ec9..23963e48d8ee6 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -9,8 +9,9 @@ #include "std.h" #include -#include +#include /* for LINUX_REBOOT_* */ #include +#include /* Only the generic macros and types may be defined here. The arch-specific @@ -92,6 +93,15 @@ #define SEEK_CUR 1 #define SEEK_END 2 +/* flags for reboot */ +#define RB_AUTOBOOT LINUX_REBOOT_CMD_RESTART +#define RB_HALT_SYSTEM LINUX_REBOOT_CMD_HALT +#define RB_ENABLE_CAD LINUX_REBOOT_CMD_CAD_ON +#define RB_DISABLE_CAD LINUX_REBOOT_CMD_CAD_OFF +#define RB_POWER_OFF LINUX_REBOOT_CMD_POWER_OFF +#define RB_SW_SUSPEND LINUX_REBOOT_CMD_SW_SUSPEND +#define RB_KEXEC LINUX_REBOOT_CMD_KEXEC + /* Macros used on waitpid()'s return status */ #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) #define WIFEXITED(status) (((status) & 0x7f) == 0) -- 2.30.2