1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/BBA1.5_platform/apps/public/strace-4.16/tests-m32/reboot.c
2024-07-22 01:58:46 -03:00

38 lines
897 B
C

#include "tests.h"
#include <asm/unistd.h>
#ifdef __NR_reboot
# include <stdio.h>
# include <linux/reboot.h>
# include <unistd.h>
# define INVALID_MAGIC 319887762
# define INVALID_CMD 0x01234568
int
main(void)
{
static const char buf[] = "reboot";
long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \
INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf);
printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */,"
" LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n",
INVALID_MAGIC, buf, rc, errno2name());
rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \
LINUX_REBOOT_MAGIC2, INVALID_CMD);
printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,"
" %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n",
INVALID_CMD, rc, errno2name());
puts("+++ exited with 0 +++");
return 0;
}
#else
SKIP_MAIN_UNDEFINED("__NR_reboot")
#endif