sys_i386_32.c 907 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * This file contains various random system calls that
  3. * have a non-standard calling sequence on the Linux/i386
  4. * platform.
  5. */
  6. #include <linux/errno.h>
  7. #include <linux/sched.h>
  8. #include <linux/mm.h>
  9. #include <linux/fs.h>
  10. #include <linux/smp.h>
  11. #include <linux/sem.h>
  12. #include <linux/msg.h>
  13. #include <linux/shm.h>
  14. #include <linux/stat.h>
  15. #include <linux/syscalls.h>
  16. #include <linux/mman.h>
  17. #include <linux/file.h>
  18. #include <linux/utsname.h>
  19. #include <linux/ipc.h>
  20. #include <linux/uaccess.h>
  21. #include <linux/unistd.h>
  22. #include <asm/syscalls.h>
  23. /*
  24. * Do a system call from kernel instead of calling sys_execve so we
  25. * end up with proper pt_regs.
  26. */
  27. int kernel_execve(const char *filename,
  28. const char *const argv[],
  29. const char *const envp[])
  30. {
  31. long __res;
  32. asm volatile ("int $0x80"
  33. : "=a" (__res)
  34. : "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
  35. return __res;
  36. }