mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
Rm useless init.sh, init_hello and poweroff are not init specific, so rename them more generically
This commit is contained in:
12
kernel_module/user/poweroff.c
Normal file
12
kernel_module/user/poweroff.c
Normal file
@@ -0,0 +1,12 @@
|
||||
/* Userspace is for the weak. Die.
|
||||
* https://stackoverflow.com/questions/28812514/how-to-shutdown-linux-using-c-or-qt-without-call-to-system
|
||||
* BusyBox's /sbin/poweroff is under init/halt.c, but it does extra crap like killing init, so I don't trust it. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
puts(__FILE__);
|
||||
reboot(RB_POWER_OFF);
|
||||
}
|
||||
Reference in New Issue
Block a user