toaruos/apps/kdebug.c

21 lines
511 B
C
Raw Normal View History

2018-08-15 04:07:33 +03:00
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* This file is part of ToaruOS and is released under the terms
2018-02-25 12:22:44 +03:00
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2014-2018 K. Lange
2018-08-15 04:07:33 +03:00
*
* kdebug - Launch kernel shell
2018-02-25 12:22:44 +03:00
*/
2018-10-30 10:56:28 +03:00
#include <errno.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/sysfunc.h>
2018-02-25 12:22:44 +03:00
int main(int argc, char * argv[]) {
sysfunc(TOARU_SYS_FUNC_KDEBUG, NULL);
2018-02-25 12:22:44 +03:00
int status;
2018-10-30 10:56:28 +03:00
while (wait(&status)) {
if (errno == ECHILD) break;
}
2018-09-28 07:00:51 +03:00
return WEXITSTATUS(status);
2018-02-25 12:22:44 +03:00
}