Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ datalock(3C) — HP-UX 6.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getprivgrp(2)

plock(2)

DATALOCK(3C)  —  HP-UX

Series 300, 800 Only

NAME

datalock − lock process into memory, after allocating data and stack space

SYNOPSIS

#include <sys/lock.h>
int datalock (datsiz, stsiz);
int datsiz, stsiz;

DESCRIPTION

Datalock allocates at least datsiz bytes of data space and stsiz bytes of stack space, then locks the program in memory.  The data space is allocated with either malloc(3C) or malloc(3X) (whichever is linked with the program).  After the program is locked, this space is released with free (on malloc(3C)) or free (on malloc(3X)), making it available for use. This allows the calling program to use that much space dynamically without receiving the SIGSEGV signal. 

The effective user ID of the calling process must be super-user or be a member of or have an effective group ID of a group having PRIV_MLOCK access to use this call (see getprivgrp(2)). 

EXAMPLES

The following call to datalock allocates 4096 bytes of data space and 2048 bytes of stack space and then locks the process in memory:

datalock (4096, 2048);

RETURN VALUE

Returns −1 if malloc cannot allocate enough memory or plock(2) returned an error. 

AUTHOR

Datalock was developed by the Hewlett-Packard Company. 

SEE ALSO

getprivgrp(2), plock(2). 

BUGS

Multiple datalock’s may not be the same as one big one. 

Methods for calculating the required size are not yet well developed. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026