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

sys_mman.h.0p (5493B)


  1. '\" et
  2. .TH sys_mman.h "0P" 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. sys/mman.h
  12. \(em memory management declarations
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <sys/mman.h>
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR <sys/mman.h>
  21. header shall define the following symbolic constants for use as
  22. protection options:
  23. .IP PROT_EXEC 14
  24. Page can be executed.
  25. .IP PROT_NONE 14
  26. Page cannot be accessed.
  27. .IP PROT_READ 14
  28. Page can be read.
  29. .IP PROT_WRITE 14
  30. Page can be written.
  31. .P
  32. The
  33. .IR <sys/mman.h>
  34. header shall define the following symbolic constants for use as
  35. flag options:
  36. .IP MAP_FIXED 14
  37. Interpret
  38. .IR addr
  39. exactly.
  40. .IP MAP_PRIVATE 14
  41. Changes are private.
  42. .IP MAP_SHARED 14
  43. Share changes.
  44. .P
  45. The
  46. .IR <sys/mman.h>
  47. header shall define the following symbolic constants for the
  48. \fImsync\fR()
  49. function:
  50. .IP MS_ASYNC 14
  51. Perform asynchronous writes.
  52. .IP MS_INVALIDATE 14
  53. Invalidate mappings.
  54. .IP MS_SYNC 14
  55. Perform synchronous writes.
  56. .P
  57. The
  58. .IR <sys/mman.h>
  59. header shall define the following symbolic constants for the
  60. \fImlockall\fR()
  61. function:
  62. .IP MCL_CURRENT 14
  63. Lock currently mapped pages.
  64. .IP MCL_FUTURE 14
  65. Lock pages that become mapped.
  66. .P
  67. The
  68. .IR <sys/mman.h>
  69. header shall define the symbolic constant MAP_FAILED which shall
  70. have type
  71. .BR "void *"
  72. and shall be used to indicate a failure from the
  73. \fImmap\fR()
  74. function .
  75. .P
  76. If the Advisory Information option is supported, the
  77. .IR <sys/mman.h>
  78. header shall define symbolic constants for the
  79. .IR advice
  80. argument to the
  81. \fIposix_madvise\fR()
  82. function as follows:
  83. .IP POSIX_MADV_DONTNEED 6
  84. .br
  85. The application expects that it will not access the specified range in
  86. the near future.
  87. .IP POSIX_MADV_NORMAL 6
  88. .br
  89. The application has no advice to give on its behavior with respect to
  90. the specified range. It is the default characteristic if no advice is
  91. given for a range of memory.
  92. .IP POSIX_MADV_RANDOM 6
  93. .br
  94. The application expects to access the specified range in a random
  95. order.
  96. .IP POSIX_MADV_SEQUENTIAL 6
  97. .br
  98. The application expects to access the specified range sequentially from
  99. lower addresses to higher addresses.
  100. .IP POSIX_MADV_WILLNEED 6
  101. .br
  102. The application expects to access the specified range in the near
  103. future.
  104. .P
  105. The
  106. .IR <sys/mman.h>
  107. header shall define the following symbolic constants for use as
  108. flags for the
  109. \fIposix_typed_mem_open\fR()
  110. function:
  111. .IP POSIX_TYPED_MEM_ALLOCATE 6
  112. .br
  113. Allocate on
  114. \fImmap\fR().
  115. .IP POSIX_TYPED_MEM_ALLOCATE_CONTIG 6
  116. .br
  117. Allocate contiguously on
  118. \fImmap\fR().
  119. .IP POSIX_TYPED_MEM_MAP_ALLOCATABLE 6
  120. .br
  121. Map on
  122. \fImmap\fR(),
  123. without affecting allocatability.
  124. .P
  125. The
  126. .IR <sys/mman.h>
  127. header shall define the
  128. .BR mode_t ,
  129. .BR off_t ,
  130. and
  131. .BR size_t
  132. types as described in
  133. .IR "\fB<sys_types.h>\fP".
  134. .P
  135. The
  136. .IR <sys/mman.h>
  137. header shall define the
  138. .BR posix_typed_mem_info
  139. structure, which shall include at least the following member:
  140. .sp
  141. .RS 4
  142. .nf
  143. size_t posix_tmi_length \fRMaximum length which may be allocated\fR
  144. \fRfrom a typed memory object.\fR
  145. .fi
  146. .P
  147. .RE
  148. .P
  149. The following shall be declared as functions and may also be defined as
  150. macros. Function prototypes shall be provided.
  151. .sp
  152. .RS 4
  153. .nf
  154. int mlock(const void *, size_t);
  155. int mlockall(int);
  156. void *mmap(void *, size_t, int, int, int, off_t);
  157. int mprotect(void *, size_t, int);
  158. int msync(void *, size_t, int);
  159. int munlock(const void *, size_t);
  160. int munlockall(void);
  161. int munmap(void *, size_t);
  162. int posix_madvise(void *, size_t, int);
  163. int posix_mem_offset(const void *restrict, size_t, off_t *restrict,
  164. size_t *restrict, int *restrict);
  165. int posix_typed_mem_get_info(int, struct posix_typed_mem_info *);
  166. int posix_typed_mem_open(const char *, int, int);
  167. int shm_open(const char *, int, mode_t);
  168. int shm_unlink(const char *);
  169. .fi
  170. .P
  171. .RE
  172. .LP
  173. .IR "The following sections are informative."
  174. .SH "APPLICATION USAGE"
  175. None.
  176. .SH RATIONALE
  177. None.
  178. .SH "FUTURE DIRECTIONS"
  179. None.
  180. .SH "SEE ALSO"
  181. .IR "\fB<sys_types.h>\fP"
  182. .P
  183. The System Interfaces volume of POSIX.1\(hy2017,
  184. .IR "\fImlock\fR\^(\|)",
  185. .IR "\fImlockall\fR\^(\|)",
  186. .IR "\fImmap\fR\^(\|)",
  187. .IR "\fImprotect\fR\^(\|)",
  188. .IR "\fImsync\fR\^(\|)",
  189. .IR "\fImunmap\fR\^(\|)",
  190. .IR "\fIposix_madvise\fR\^(\|)",
  191. .IR "\fIposix_mem_offset\fR\^(\|)",
  192. .IR "\fIposix_typed_mem_get_info\fR\^(\|)",
  193. .IR "\fIposix_typed_mem_open\fR\^(\|)",
  194. .IR "\fIshm_open\fR\^(\|)",
  195. .IR "\fIshm_unlink\fR\^(\|)"
  196. .\"
  197. .SH COPYRIGHT
  198. Portions of this text are reprinted and reproduced in electronic form
  199. from IEEE Std 1003.1-2017, Standard for Information Technology
  200. -- Portable Operating System Interface (POSIX), The Open Group Base
  201. Specifications Issue 7, 2018 Edition,
  202. Copyright (C) 2018 by the Institute of
  203. Electrical and Electronics Engineers, Inc and The Open Group.
  204. In the event of any discrepancy between this version and the original IEEE and
  205. The Open Group Standard, the original IEEE and The Open Group Standard
  206. is the referee document. The original Standard can be obtained online at
  207. http://www.opengroup.org/unix/online.html .
  208. .PP
  209. Any typographical or formatting errors that appear
  210. in this page are most likely
  211. to have been introduced during the conversion of the source files to
  212. man page format. To report such errors, see
  213. https://www.kernel.org/doc/man-pages/reporting_bugs.html .