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

mlockall.3p (5234B)


  1. '\" et
  2. .TH MLOCKALL "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. mlockall,
  12. munlockall
  13. \(em lock/unlock the address space of a process
  14. (\fBREALTIME\fP)
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <sys/mman.h>
  19. .P
  20. int mlockall(int \fIflags\fP);
  21. int munlockall(void);
  22. .fi
  23. .SH DESCRIPTION
  24. The
  25. \fImlockall\fR()
  26. function shall cause all of the pages mapped by the address space of a
  27. process to be memory-resident until unlocked or until the process exits
  28. or
  29. .IR exec s
  30. another process image. The
  31. .IR flags
  32. argument determines whether the pages to be locked are those currently
  33. mapped by the address space of the process, those that are mapped
  34. in the future, or both. The
  35. .IR flags
  36. argument is constructed from the bitwise-inclusive OR of one or more
  37. of the following symbolic constants, defined in
  38. .IR <sys/mman.h> :
  39. .IP MCL_CURRENT 12
  40. Lock all of the pages currently mapped into the address space of the
  41. process.
  42. .IP MCL_FUTURE 12
  43. Lock all of the pages that become mapped into the address space of the
  44. process in the future, when those mappings are established.
  45. .P
  46. If MCL_FUTURE is specified, and the automatic locking of future
  47. mappings eventually causes the amount of locked memory to exceed the
  48. amount of available physical memory or any other
  49. implementation-defined limit, the behavior is
  50. implementation-defined. The manner in which the implementation
  51. informs the application of these situations is also
  52. implementation-defined.
  53. .P
  54. The
  55. \fImunlockall\fR()
  56. function shall unlock all currently mapped pages of the address space
  57. of the process. Any pages that become mapped into the address space of
  58. the process after a call to
  59. \fImunlockall\fR()
  60. shall not be locked, unless there is an intervening call to
  61. \fImlockall\fR()
  62. specifying MCL_FUTURE or a subsequent call to
  63. \fImlockall\fR()
  64. specifying MCL_CURRENT. If pages mapped into the address space of the
  65. process are also mapped into the address spaces of other processes and
  66. are locked by those processes, the locks established by the other
  67. processes shall be unaffected by a call by this process to
  68. \fImunlockall\fR().
  69. .P
  70. Upon successful return from the
  71. \fImlockall\fR()
  72. function that specifies MCL_CURRENT, all currently mapped pages of the
  73. address space of the process shall be memory-resident and locked.
  74. Upon return from the
  75. \fImunlockall\fR()
  76. function, all currently mapped pages of the address space of the process
  77. shall be unlocked with respect to the address space of the process.
  78. The memory residency of unlocked pages is unspecified.
  79. .P
  80. Appropriate privileges are required to lock process memory with
  81. \fImlockall\fR().
  82. .SH "RETURN VALUE"
  83. Upon successful completion, the
  84. \fImlockall\fR()
  85. function shall return a value of zero. Otherwise, no additional memory
  86. shall be locked, and the function shall return a value of \-1 and set
  87. .IR errno
  88. to indicate the error. The effect of failure of
  89. \fImlockall\fR()
  90. on previously existing locks in the address space is unspecified.
  91. .P
  92. If it is supported by the implementation, the
  93. \fImunlockall\fR()
  94. function shall always return a value of zero. Otherwise, the function
  95. shall return a value of \-1 and set
  96. .IR errno
  97. to indicate the error.
  98. .SH ERRORS
  99. The
  100. \fImlockall\fR()
  101. function shall fail if:
  102. .TP
  103. .BR EAGAIN
  104. Some or all of the memory identified by the operation could not be
  105. locked when the call was made.
  106. .TP
  107. .BR EINVAL
  108. The
  109. .IR flags
  110. argument is zero, or includes unimplemented flags.
  111. .P
  112. The
  113. \fImlockall\fR()
  114. function may fail if:
  115. .TP
  116. .BR ENOMEM
  117. Locking all of the pages currently mapped into the address space of the
  118. process would exceed an implementation-defined limit on the amount of
  119. memory that the process may lock.
  120. .TP
  121. .BR EPERM
  122. The calling process does not have appropriate privileges to perform
  123. the requested operation.
  124. .LP
  125. .IR "The following sections are informative."
  126. .SH EXAMPLES
  127. None.
  128. .SH "APPLICATION USAGE"
  129. None.
  130. .SH RATIONALE
  131. None.
  132. .SH "FUTURE DIRECTIONS"
  133. None.
  134. .SH "SEE ALSO"
  135. .IR "\fIexec\fR\^",
  136. .IR "\fIexit\fR\^(\|)",
  137. .IR "\fIfork\fR\^(\|)",
  138. .IR "\fImlock\fR\^(\|)",
  139. .IR "\fImunmap\fR\^(\|)"
  140. .P
  141. The Base Definitions volume of POSIX.1\(hy2017,
  142. .IR "\fB<sys_mman.h>\fP"
  143. .\"
  144. .SH COPYRIGHT
  145. Portions of this text are reprinted and reproduced in electronic form
  146. from IEEE Std 1003.1-2017, Standard for Information Technology
  147. -- Portable Operating System Interface (POSIX), The Open Group Base
  148. Specifications Issue 7, 2018 Edition,
  149. Copyright (C) 2018 by the Institute of
  150. Electrical and Electronics Engineers, Inc and The Open Group.
  151. In the event of any discrepancy between this version and the original IEEE and
  152. The Open Group Standard, the original IEEE and The Open Group Standard
  153. is the referee document. The original Standard can be obtained online at
  154. http://www.opengroup.org/unix/online.html .
  155. .PP
  156. Any typographical or formatting errors that appear
  157. in this page are most likely
  158. to have been introduced during the conversion of the source files to
  159. man page format. To report such errors, see
  160. https://www.kernel.org/doc/man-pages/reporting_bugs.html .