2 .\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH MLOCKALL 3C "Mar 22, 2004"
8 mlockall, munlockall \- lock or unlock address space
14 \fBint\fR \fBmlockall\fR(\fBint\fR \fIflags\fR);
19 \fBint\fR \fBmunlockall\fR(\fBvoid\fR);
25 The \fBmlockall()\fR function locks in memory all pages mapped by an address
29 The value of \fIflags\fR determines whether the pages to be locked are those
30 currently mapped by the address space, those that will be mapped in the future,
35 \fBMCL_CURRENT\fR Lock current mappings
36 \fBMCL_FUTURE\fR Lock future mappings
42 If \fBMCL_FUTURE\fR is specified for \fBmlockall()\fR, mappings are locked as
43 they are added to the address space (or replace existing mappings), provided
44 sufficient memory is available. Locking in this manner is not persistent across
45 the \fBexec\fR family of functions (see \fBexec\fR(2)).
48 Mappings locked using \fBmlockall()\fR with any option may be explicitly
49 unlocked with a \fBmunlock()\fR call (see \fBmlock\fR(3C)).
52 The \fBmunlockall()\fR function removes address space locks and locks on
53 mappings in the address space.
56 All conditions and constraints on the use of locked memory that apply to
57 \fBmlock\fR(3C) also apply to \fBmlockall()\fR.
60 Locks established with \fBmlockall()\fR are not inherited by a child process
61 after a \fBfork\fR(2) call, and are not nested.
65 Upon successful completion, the \fBmlockall()\fR and \fBmunlockall()\fR
66 functions return \fB0\fR. Otherwise, they return \fB\(mi1\fR and set
67 \fBerrno\fR to indicate the error.
71 The \fBmlockall()\fR and \fBmunlockall()\fR functions will fail if:
78 Some or all of the memory in the address space could not be locked due to
79 sufficient resources. This error condition applies to \fBmlockall()\fR only.
88 The \fIflags\fR argument contains values other than \fBMCL_CURRENT\fR and
98 The {\fBPRIV_PROC_LOCK_MEMORY\fR} privilege is not asserted in the effective
99 set of the calling process.
105 See \fBattributes\fR(5) for descriptions of the following attributes:
113 ATTRIBUTE TYPE ATTRIBUTE VALUE
115 Interface Stability Standard
123 \fBexec\fR(2), \fBfork\fR(2), \fBmemcntl\fR(2), \fBmmap\fR(2), \fBplock\fR(3C),
124 \fBmlock\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)