mremap.c 733 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 2017 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. #include <errno.h>
  6. #include <stdarg.h>
  7. #include <sysdep.h>
  8. #include <sys/mman.h>
  9. #include <sys/syscall.h>
  10. #ifdef __NR_mremap
  11. void *mremap (void *__addr, size_t __old_len, size_t __new_len,
  12. int __flags, ...);
  13. libc_hidden_proto(mremap)
  14. void *mremap (void *__addr, size_t __old_len, size_t __new_len, int __flags, ...)
  15. {
  16. unsigned long arg1;
  17. va_list arg;
  18. va_start (arg, __flags);
  19. arg1 = va_arg (arg, int);
  20. va_end (arg);
  21. return (void *)INLINE_SYSCALL(mremap,5,__addr,__old_len,__new_len,__flags,arg1);
  22. }
  23. libc_hidden_def (mremap)
  24. #endif