vm_readp Kernel Service

Purpose

Initiates asynchronous page-in for the range of pages specified.

Syntax

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

int vm_readp ( sid, pfirst, npages, flags)
vmid_t sid;
vpn_t pfirst;
vpn_t npages;
int flags;

Parameters

Item Description
sid Identifies the base segment.
pfirst The first page number within the range.
npages The number of pages to read starting from the pfirst value. All pages must be in the same segment.
flags Flags used by the function.

Description

The vm_readp kernel service routine begins the process of reading a page. This call is strictly advisory and might return without having done anything.

The only flag passed in through the flag parameter, VM_IOWAIT, tells the vm_readp kernel service to wait for any page I/O in the range to complete before initiating the read operation. This flag is optional.

Execution Environment

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

Return Values

Item Description
0 Indicates that the I/O access operations completed successfully.
EINVAL Indicates one of the following errors:
  • pfirst < 0.
  • npages < 0.
  • Page interval > Maximum file size.
  • The sid parameter is not valid.
  • Not a file or persistent storage segment.