Files
xv6-custom-os/shutdown.c
2022-12-06 11:49:47 +00:00

24 lines
440 B
C

#include "types.h"
#include "user.h"
int main(int argc, char *argv[]) {
int restart = 0;
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "-r") == 0) {
restart = 1;
}
}
switch(restart) {
case 0:
printf(1, "Shutting Down...\n");
break;
case 1:
printf(1, "Restarting...\n");
break;
}
shutdown(restart);
exit();
}