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