Files
linux-kernel-module-cheat/userland/init_env_poweroff.c
Ciro Santilli 六四事件 法轮功 ca231b82f6 get rid of lkmc package, move userland and kernel-modules to top
Rationale: we already had a non buildroot build system,
maintaining both will be hard, and having short paths is more awesome.
2018-10-25 00:00:02 +00:00

27 lines
374 B
C

#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <sys/reboot.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int i;
puts("args:");
for (i = 0; i < argc; ++i)
puts(argv[i]);
puts("");
puts("env:");
extern char **environ;
char **env = environ;
while (*env) {
printf("%s\n", *env);
env++;
}
puts("");
/* Poweroff. */
reboot(RB_POWER_OFF);
}