mmap.c 727 B

123456789101112131415161718192021222324252627282930
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * _mmap() for uClibc
  4. *
  5. * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
  6. *
  7. * GNU Library General Public License (LGPL) version 2 or later.
  8. */
  9. #include <errno.h>
  10. #include <unistd.h>
  11. #include <sys/mman.h>
  12. #include <sys/syscall.h>
  13. libc_hidden_proto (mmap)
  14. #if defined __ARM_EABI__
  15. #define __NR__mmap __NR_mmap2
  16. #else
  17. #define __NR__mmap __NR_mmap
  18. #endif
  19. static inline _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len,
  20. int, prot, int, flags, int, fd, __off_t, offset);
  21. __ptr_t mmap(__ptr_t addr, size_t len, int prot,
  22. int flags, int fd, __off_t offset)
  23. {
  24. return (__ptr_t) _mmap (addr, len, prot, flags, fd, offset);
  25. }
  26. libc_hidden_def (mmap)