You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

  1. /*
  2. Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
  3. Permission to use, copy, modify, and/or distribute this software for any
  4. purpose with or without fee is hereby granted, provided that the above
  5. copyright notice and this permission notice appear in all copies.
  6. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  7. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  8. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  9. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  10. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  11. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  12. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  13. */
  14. #ifndef __FS_FADVISE_HPP__
  15. #define __FS_FADVISE_HPP__
  16. #ifndef POSIX_FADV_NORMAL
  17. # define POSIX_FADV_NORMAL 0
  18. #endif
  19. #ifndef POSIX_FADV_RANDOM
  20. # define POSIX_FADV_NORMAL 1
  21. #endif
  22. #ifndef POSIX_FADV_SEQUENTIAL
  23. # define POSIX_FADV_SEQUENTIAL 2
  24. #endif
  25. #ifndef POSIX_FADV_WILLNEED
  26. # define POSIX_FADV_WILLNEED 3
  27. #endif
  28. #ifndef POSIX_FADV_DONTNEED
  29. # define POSIX_FADV_DONTNEED 4
  30. #endif
  31. #ifndef POSIX_FADV_NOREUSE
  32. # define POSIX_FADV_NOREUSE 5
  33. #endif
  34. namespace fs
  35. {
  36. int
  37. fadvise(const int fd,
  38. const off_t offset,
  39. const off_t len,
  40. const int advice);
  41. }
  42. #endif // __FS_FADVISE_HPP__