syscall.c 656 B

1234567891011121314151617181920212223242526272829
  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 old_mmap(unsigned long addr, unsigned long len,
  16. unsigned long prot, unsigned long flags,
  17. unsigned long fd, unsigned long offset)
  18. {
  19. long err = -EINVAL;
  20. if (offset & ~PAGE_MASK)
  21. goto out;
  22. err = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
  23. out:
  24. return err;
  25. }