at v6.19 34 lines 718 B view raw
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 7/* make sure to include all global symbols */ 8#include "../nolibc.h" 9 10#ifndef _NOLIBC_SYS_REBOOT_H 11#define _NOLIBC_SYS_REBOOT_H 12 13#include "../sys.h" 14 15#include <linux/reboot.h> 16 17/* 18 * int reboot(int cmd); 19 * <cmd> is among LINUX_REBOOT_CMD_* 20 */ 21 22static __attribute__((unused)) 23ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg) 24{ 25 return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg); 26} 27 28static __attribute__((unused)) 29int reboot(int cmd) 30{ 31 return __sysret(sys_reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, NULL)); 32} 33 34#endif /* _NOLIBC_SYS_REBOOT_H */