posix_fadvise.c 850 B

12345678910111213141516171819202122232425262728293031323334
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * posix_fadvise() for uClibc
  4. *
  5. * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <sys/syscall.h>
  10. #if defined __USE_GNU
  11. #include <fcntl.h>
  12. #if defined __NR_fadvise64_64 || defined __NR_fadvise64
  13. libc_hidden_proto(posix_fadvise64)
  14. libc_hidden_proto(posix_fadvise)
  15. int posix_fadvise(int fd, off_t offset, off_t len, int advice)
  16. {
  17. if (posix_fadvise64(fd, offset, len, advice) != 0)
  18. return errno;
  19. return 0;
  20. }
  21. libc_hidden_def(posix_fadvise)
  22. #elif defined __UCLIBC_HAS_STUBS__
  23. libc_hidden_proto(posix_fadvise)
  24. int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused,
  25. off_t len attribute_unused, int advice attribute_unused)
  26. {
  27. return ENOSYS;
  28. }
  29. libc_hidden_def(posix_fadvise)
  30. #endif
  31. #endif