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, unless the V_READMAKE flag is used.
flags Flags used by the function.

Description

The vm_readp kernel service routine starts the process of paging within the range of specified pages. This call is strictly advisory and might return without performing any operations.

The flags parameter is optional and accepts the following values:
V_IOWAIT
Instructs the vm_readp kernel service to wait for any page I/O requests to complete, within the range of specified pages, before initiating the read operation.
V_READMAKE
Instructs the vm_readp kernel service to create the segments within the range of the vm_readp operation.

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 and npages = 0.
  • pfirst < 0.
  • npages < 0.
  • Page interval > Maximum file size.
  • The sid parameter is not valid.
  • Not a file or persistent storage segment.