aboutsummaryrefslogtreecommitdiffstats
path: root/usr/poweroff.c
blob: d57dbc90ba00d2941636f72e6d5846156e6700b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#include "gbos.h"
/* poweroff: shut the machine down cleanly.
 * This is the ONLY safe way to stop a gbos with data on the disk: the cart's
 * battery-backed RAM is only written out when the emulator exits properly,
 * so pulling the plug (SIGKILL, closing the window) loses the whole
 * filesystem - it comes back "formatted" on the next boot. */
void main(void) {
    puts("poweroff: syncing disk...");
    nl();
    poweroff();
}