syscall_kern.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  3. * Licensed under the GPL
  4. */
  5. #include "linux/types.h"
  6. #include "linux/utime.h"
  7. #include "linux/sys.h"
  8. #include "linux/ptrace.h"
  9. #include "asm/unistd.h"
  10. #include "asm/ptrace.h"
  11. #include "asm/uaccess.h"
  12. #include "asm/stat.h"
  13. #include "sysdep/syscalls.h"
  14. #include "kern_util.h"
  15. extern syscall_handler_t *sys_call_table[];
  16. long execute_syscall_tt(void *r)
  17. {
  18. struct pt_regs *regs = r;
  19. long res;
  20. int syscall;
  21. #ifdef CONFIG_SYSCALL_DEBUG
  22. current->thread.nsyscalls++;
  23. nsyscalls++;
  24. #endif
  25. syscall = UPT_SYSCALL_NR(&regs->regs);
  26. if((syscall >= NR_syscalls) || (syscall < 0))
  27. res = -ENOSYS;
  28. else res = EXECUTE_SYSCALL(syscall, regs);
  29. return(res);
  30. }
  31. /*
  32. * Overrides for Emacs so that we follow Linus's tabbing style.
  33. * Emacs will notice this stuff at the end of the file and automatically
  34. * adjust the settings for this buffer only. This must remain at the end
  35. * of the file.
  36. * ---------------------------------------------------------------------------
  37. * Local variables:
  38. * c-file-style: "linux"
  39. * End:
  40. */