logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

posix_fadvise.3p (3961B)


  1. '\" et
  2. .TH POSIX_FADVISE "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. posix_fadvise
  12. \(em file advisory information
  13. (\fBADVANCED REALTIME\fP)
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <fcntl.h>
  18. .P
  19. int posix_fadvise(int \fIfd\fP, off_t \fIoffset\fP, off_t \fIlen\fP, int \fIadvice\fP);
  20. .fi
  21. .SH DESCRIPTION
  22. The
  23. \fIposix_fadvise\fR()
  24. function shall advise the implementation on the expected behavior
  25. of the application with respect to the data in the file associated with
  26. the open file descriptor,
  27. .IR fd ,
  28. starting at
  29. .IR offset
  30. and continuing for
  31. .IR len
  32. bytes. The specified range need not currently exist in the file. If
  33. .IR len
  34. is zero, all data following
  35. .IR offset
  36. is specified. The implementation may use this information to optimize
  37. handling of the specified data. The
  38. \fIposix_fadvise\fR()
  39. function shall have no effect on the semantics of other operations on
  40. the specified data, although it may affect the performance of other
  41. operations.
  42. .P
  43. The advice to be applied to the data is specified by the
  44. .IR advice
  45. parameter and may be one of the following values:
  46. .IP POSIX_FADV_NORMAL 6
  47. .br
  48. Specifies that the application has no advice to give on its behavior
  49. with respect to the specified data. It is the default characteristic if
  50. no advice is given for an open file.
  51. .IP POSIX_FADV_SEQUENTIAL 6
  52. .br
  53. Specifies that the application expects to access the specified data
  54. sequentially from lower offsets to higher offsets.
  55. .IP POSIX_FADV_RANDOM 6
  56. .br
  57. Specifies that the application expects to access the specified data in
  58. a random order.
  59. .IP POSIX_FADV_WILLNEED 6
  60. .br
  61. Specifies that the application expects to access the specified data in
  62. the near future.
  63. .IP POSIX_FADV_DONTNEED 6
  64. .br
  65. Specifies that the application expects that it will not access the
  66. specified data in the near future.
  67. .IP POSIX_FADV_NOREUSE 6
  68. .br
  69. Specifies that the application expects to access the specified data
  70. once and then not reuse it thereafter.
  71. .P
  72. These values are defined in
  73. .IR <fcntl.h> .
  74. .SH "RETURN VALUE"
  75. Upon successful completion,
  76. \fIposix_fadvise\fR()
  77. shall return zero; otherwise, an error number shall be returned to
  78. indicate the error.
  79. .SH ERRORS
  80. The
  81. \fIposix_fadvise\fR()
  82. function shall fail if:
  83. .TP
  84. .BR EBADF
  85. The
  86. .IR fd
  87. argument is not a valid file descriptor.
  88. .TP
  89. .BR EINVAL
  90. The value of
  91. .IR advice
  92. is invalid, or the value of
  93. .IR len
  94. is less than zero.
  95. .TP
  96. .BR ESPIPE
  97. The
  98. .IR fd
  99. argument is associated with a pipe or FIFO.
  100. .LP
  101. .IR "The following sections are informative."
  102. .SH EXAMPLES
  103. None.
  104. .SH "APPLICATION USAGE"
  105. The
  106. \fIposix_fadvise\fR()
  107. function is part of the Advisory Information option and need not be
  108. provided on all implementations.
  109. .SH RATIONALE
  110. None.
  111. .SH "FUTURE DIRECTIONS"
  112. None.
  113. .SH "SEE ALSO"
  114. .IR "\fIposix_madvise\fR\^(\|)"
  115. .P
  116. The Base Definitions volume of POSIX.1\(hy2017,
  117. .IR "\fB<fcntl.h>\fP"
  118. .\"
  119. .SH COPYRIGHT
  120. Portions of this text are reprinted and reproduced in electronic form
  121. from IEEE Std 1003.1-2017, Standard for Information Technology
  122. -- Portable Operating System Interface (POSIX), The Open Group Base
  123. Specifications Issue 7, 2018 Edition,
  124. Copyright (C) 2018 by the Institute of
  125. Electrical and Electronics Engineers, Inc and The Open Group.
  126. In the event of any discrepancy between this version and the original IEEE and
  127. The Open Group Standard, the original IEEE and The Open Group Standard
  128. is the referee document. The original Standard can be obtained online at
  129. http://www.opengroup.org/unix/online.html .
  130. .PP
  131. Any typographical or formatting errors that appear
  132. in this page are most likely
  133. to have been introduced during the conversion of the source files to
  134. man page format. To report such errors, see
  135. https://www.kernel.org/doc/man-pages/reporting_bugs.html .