vms_create Kernel Service

Purpose

Creates a virtual memory object of the specified type, size, and limits.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/vmuser.h>

int vms_create (vmid, type, devgno, size, uplim, downlim)
vmid_t * vmid;
int   type;
dev_t devgno;
int   size;
int   uplim;
int   downlim;

Parameters

Item Description
vmid Points to the variable in which the virtual memory object identifier is to be stored.
type Specifies the virtual memory object type and options as an OR of bits. The type parameter must have the value of V_CLIENT. The V_INTRSEG flag specifies if the process can be interrupted from a page wait on this object.
devgno Specifies the address of the g-node for client storage. If the type parameter has the value of V_CLIENT, the third argument is a g-node ptr argument, otherwise, it is a devgno argument.
size Specifies the current size of the file (in bytes). This can be any valid file size. If the V_LARGE is specified, it is interpreted as number of pages.
uplim Ignored. The enforcement of file size limits is done by comparing with the u_limit value in the u block.
downlim Ignored.

Description

The vms_create kernel service creates a virtual memory object. The resulting virtual memory object identifier is passed back by reference in the vmid parameter.

The size parameter is used to determine the size in units of bytes of the virtual memory object to be created. This parameter sets an internal variable that determines the virtual memory range to be processed when the virtual memory object is deleted.

An entry for the file system is required in the paging device table when the vms_create kernel service is called.

Execution Environment

The vms_create kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates a successful operation.
ENOMEM Indicates that no space is available for the virtual memory object.
ENODEV Indicates no entry for the file system in the paging device table.
EINVAL Indicates incompatible or bad parameters.