posix_fadvise.c 942 B

123456789101112131415161718192021222324252627282930313233343536
  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. extern int __libc_posix_fadvise64 (int, __off64_t, __off64_t, int ) __THROW;
  14. libc_hidden_proto(__libc_posix_fadvise64)
  15. libc_hidden_proto(posix_fadvise)
  16. int posix_fadvise(int fd, off_t offset, off_t len, int advice)
  17. {
  18. if (__libc_posix_fadvise64(fd, offset, len, advice) != 0)
  19. return errno;
  20. return 0;
  21. }
  22. libc_hidden_def(posix_fadvise)
  23. #elif defined __UCLIBC_HAS_STUBS__
  24. libc_hidden_proto(posix_fadvise)
  25. int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused,
  26. off_t len attribute_unused, int advice attribute_unused)
  27. {
  28. return ENOSYS;
  29. }
  30. libc_hidden_def(posix_fadvise)
  31. #endif
  32. #endif