kdebug.c 511 B

1234567891011121314151617181920
  1. /* vim: tabstop=4 shiftwidth=4 noexpandtab
  2. * This file is part of ToaruOS and is released under the terms
  3. * of the NCSA / University of Illinois License - see LICENSE.md
  4. * Copyright (C) 2014-2018 K. Lange
  5. *
  6. * kdebug - Launch kernel shell
  7. */
  8. #include <errno.h>
  9. #include <stdlib.h>
  10. #include <sys/wait.h>
  11. #include <sys/sysfunc.h>
  12. int main(int argc, char * argv[]) {
  13. sysfunc(TOARU_SYS_FUNC_KDEBUG, NULL);
  14. int status;
  15. while (wait(&status)) {
  16. if (errno == ECHILD) break;
  17. }
  18. return WEXITSTATUS(status);
  19. }