syscall_user.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #include <stdlib.h>
  6. #include <signal.h>
  7. #include "kern_util.h"
  8. #include "uml-config.h"
  9. #include "syscall_user.h"
  10. #include "sysdep/ptrace.h"
  11. #include "sysdep/sigcontext.h"
  12. #include "skas.h"
  13. void handle_syscall(union uml_pt_regs *regs)
  14. {
  15. long result;
  16. #if UML_CONFIG_SYSCALL_DEBUG
  17. int index;
  18. index = record_syscall_start(UPT_SYSCALL_NR(regs));
  19. #endif
  20. syscall_trace(regs, 0);
  21. result = execute_syscall_skas(regs);
  22. REGS_SET_SYSCALL_RETURN(regs->skas.regs, result);
  23. syscall_trace(regs, 1);
  24. #if UML_CONFIG_SYSCALL_DEBUG
  25. record_syscall_end(index, result);
  26. #endif
  27. }
  28. /*
  29. * Overrides for Emacs so that we follow Linus's tabbing style.
  30. * Emacs will notice this stuff at the end of the file and automatically
  31. * adjust the settings for this buffer only. This must remain at the end
  32. * of the file.
  33. * ---------------------------------------------------------------------------
  34. * Local variables:
  35. * c-file-style: "linux"
  36. * End:
  37. */