Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/mlock.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 | .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 17, 2014 | .Dd Jan 22, 2018 | ||||
.Dt MLOCK 2 | .Dt MLOCK 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm mlock , | .Nm mlock , | ||||
.Nm munlock | .Nm munlock | ||||
.Nd lock (unlock) physical pages in memory | .Nd lock (unlock) physical pages in memory | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
.Fn mlock | .Fn mlock | ||||
system call | system call | ||||
will fail if: | will fail if: | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EPERM | .It Bq Er EPERM | ||||
.Va security.bsd.unprivileged_mlock | .Va security.bsd.unprivileged_mlock | ||||
is set to 0 and the caller is not the super-user. | is set to 0 and the caller is not the super-user. | ||||
.It Bq Er EINVAL | .It Bq Er EINVAL | ||||
The address given is not page aligned or the length is negative. | The address range given wraps around zero. | ||||
.It Bq Er EAGAIN | .It Bq Er EAGAIN | ||||
Locking the indicated range would exceed the system limit for locked memory. | Locking the indicated range would exceed the system limit for locked memory. | ||||
.It Bq Er ENOMEM | .It Bq Er ENOMEM | ||||
Some portion of the indicated address range is not allocated. | Some portion of the indicated address range is not allocated. | ||||
There was an error faulting/mapping a page. | There was an error faulting/mapping a page. | ||||
Locking the indicated range would exceed the per-process limit for locked | Locking the indicated range would exceed the per-process limit for locked | ||||
memory. | memory. | ||||
.El | .El | ||||
The | The | ||||
.Fn munlock | .Fn munlock | ||||
system call | system call | ||||
will fail if: | will fail if: | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EPERM | .It Bq Er EPERM | ||||
.Va security.bsd.unprivileged_mlock | .Va security.bsd.unprivileged_mlock | ||||
is set to 0 and the caller is not the super-user. | is set to 0 and the caller is not the super-user. | ||||
.It Bq Er EINVAL | .It Bq Er EINVAL | ||||
The address given is not page aligned or the length is negative. | The address range given wraps around zero. | ||||
.It Bq Er ENOMEM | .It Bq Er ENOMEM | ||||
Some or all of the address range specified by the addr and len | Some or all of the address range specified by the addr and len | ||||
arguments does not correspond to valid mapped pages in the address space | arguments does not correspond to valid mapped pages in the address space | ||||
of the process. | of the process. | ||||
.It Bq Er ENOMEM | .It Bq Er ENOMEM | ||||
Locking the pages mapped by the specified range would exceed a limit on | Locking the pages mapped by the specified range would exceed a limit on | ||||
the amount of memory that the process may lock. | the amount of memory that the process may lock. | ||||
.El | .El | ||||
Show All 29 Lines |