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_madvise.3p (4172B)


  1. '\" et
  2. .TH POSIX_MADVISE "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_madvise
  12. \(em memory advisory information and alignment control
  13. (\fBADVANCED REALTIME\fP)
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <sys/mman.h>
  18. .P
  19. int posix_madvise(void *\fIaddr\fP, size_t \fIlen\fP, int \fIadvice\fP);
  20. .fi
  21. .SH DESCRIPTION
  22. The
  23. \fIposix_madvise\fR()
  24. function shall advise the implementation on the expected behavior of
  25. the application with respect to the data in the memory starting at
  26. address
  27. .IR addr ,
  28. and continuing for
  29. .IR len
  30. bytes. The implementation may use this information to optimize handling
  31. of the specified data. The
  32. \fIposix_madvise\fR()
  33. function shall have no effect on the semantics of access to memory in
  34. the specified range, although it may affect the performance of access.
  35. .P
  36. The implementation may require that
  37. .IR addr
  38. be a multiple of the page size, which is the value returned by
  39. \fIsysconf\fR()
  40. when the name value _SC_PAGESIZE is used.
  41. .P
  42. The advice to be applied to the memory range is specified by the
  43. .IR advice
  44. parameter and may be one of the following values:
  45. .IP POSIX_MADV_NORMAL 6
  46. .br
  47. Specifies that the application has no advice to give on its behavior
  48. with respect to the specified range. It is the default characteristic
  49. if no advice is given for a range of memory.
  50. .IP POSIX_MADV_SEQUENTIAL 6
  51. .br
  52. Specifies that the application expects to access the specified range
  53. sequentially from lower addresses to higher addresses.
  54. .IP POSIX_MADV_RANDOM 6
  55. .br
  56. Specifies that the application expects to access the specified range in
  57. a random order.
  58. .IP POSIX_MADV_WILLNEED 6
  59. .br
  60. Specifies that the application expects to access the specified range in
  61. the near future.
  62. .IP POSIX_MADV_DONTNEED 6
  63. .br
  64. Specifies that the application expects that it will not access the
  65. specified range in the near future.
  66. .P
  67. These values are defined in the
  68. .IR <sys/mman.h>
  69. header.
  70. .SH "RETURN VALUE"
  71. Upon successful completion,
  72. \fIposix_madvise\fR()
  73. shall return zero; otherwise, an error number shall be returned to
  74. indicate the error.
  75. .SH ERRORS
  76. The
  77. \fIposix_madvise\fR()
  78. function shall fail if:
  79. .TP
  80. .BR EINVAL
  81. The value of
  82. .IR advice
  83. is invalid.
  84. .TP
  85. .BR ENOMEM
  86. Addresses in the range starting at
  87. .IR addr
  88. and continuing for
  89. .IR len
  90. bytes are partly or completely outside the range allowed for the
  91. address space of the calling process.
  92. .br
  93. .P
  94. The
  95. \fIposix_madvise\fR()
  96. function may fail if:
  97. .TP
  98. .BR EINVAL
  99. The value of
  100. .IR addr
  101. is not a multiple of the value returned by
  102. \fIsysconf\fR()
  103. when the name value _SC_PAGESIZE is used.
  104. .TP
  105. .BR EINVAL
  106. The value of
  107. .IR len
  108. is zero.
  109. .LP
  110. .IR "The following sections are informative."
  111. .SH EXAMPLES
  112. None.
  113. .SH "APPLICATION USAGE"
  114. The
  115. \fIposix_madvise\fR()
  116. function is part of the Advisory Information option and need not be
  117. provided on all implementations.
  118. .SH RATIONALE
  119. None.
  120. .SH "FUTURE DIRECTIONS"
  121. None.
  122. .SH "SEE ALSO"
  123. .IR "\fImmap\fR\^(\|)",
  124. .IR "\fIposix_fadvise\fR\^(\|)",
  125. .IR "\fIsysconf\fR\^(\|)"
  126. .P
  127. The Base Definitions volume of POSIX.1\(hy2017,
  128. .IR "\fB<sys_mman.h>\fP"
  129. .\"
  130. .SH COPYRIGHT
  131. Portions of this text are reprinted and reproduced in electronic form
  132. from IEEE Std 1003.1-2017, Standard for Information Technology
  133. -- Portable Operating System Interface (POSIX), The Open Group Base
  134. Specifications Issue 7, 2018 Edition,
  135. Copyright (C) 2018 by the Institute of
  136. Electrical and Electronics Engineers, Inc and The Open Group.
  137. In the event of any discrepancy between this version and the original IEEE and
  138. The Open Group Standard, the original IEEE and The Open Group Standard
  139. is the referee document. The original Standard can be obtained online at
  140. http://www.opengroup.org/unix/online.html .
  141. .PP
  142. Any typographical or formatting errors that appear
  143. in this page are most likely
  144. to have been introduced during the conversion of the source files to
  145. man page format. To report such errors, see
  146. https://www.kernel.org/doc/man-pages/reporting_bugs.html .