syscall.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #include <linux/file.h>
  6. #include <linux/fs.h>
  7. #include <linux/mm.h>
  8. #include <linux/sched.h>
  9. #include <linux/utsname.h>
  10. #include <linux/syscalls.h>
  11. #include <asm/current.h>
  12. #include <asm/mman.h>
  13. #include <asm/uaccess.h>
  14. #include <asm/unistd.h>
  15. long sys_fork(void)
  16. {
  17. return do_fork(SIGCHLD, 0,
  18. &current->thread.regs, 0, NULL, NULL);
  19. }
  20. long sys_vfork(void)
  21. {
  22. return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
  23. &current->thread.regs, 0, NULL, NULL);
  24. }
  25. long sys_clone(unsigned long clone_flags, unsigned long newsp,
  26. void __user *parent_tid, void __user *child_tid)
  27. {
  28. return do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid,
  29. child_tid);
  30. }
  31. long old_mmap(unsigned long addr, unsigned long len,
  32. unsigned long prot, unsigned long flags,
  33. unsigned long fd, unsigned long offset)
  34. {
  35. long err = -EINVAL;
  36. if (offset & ~PAGE_MASK)
  37. goto out;
  38. err = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
  39. out:
  40. return err;
  41. }