mmap64.c 517 B

1234567891011121314151617181920212223242526272829
  1. /* The mmap test is useful, since syscalls with 6 arguments
  2. * (as mmap) are done differently on various architectures.
  3. */
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <unistd.h>
  7. #include <sys/mman.h>
  8. #include <features.h>
  9. int main(int argc, char **argv)
  10. {
  11. #ifdef __UCLIBC_HAS_LFS__
  12. void *ptr;
  13. ptr = mmap64(NULL, 4096, PROT_READ|PROT_WRITE,
  14. MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
  15. if (ptr == MAP_FAILED) {
  16. perror("mmap");
  17. exit(1);
  18. }
  19. printf("mmap returned %p\n", ptr);
  20. exit(0);
  21. #else
  22. exit(0);
  23. #endif
  24. }