Programming Interfaces Guide

Administrative Operations

RSM segment IDs can be specified by the application or generated by the system using the rsm_memseg_export_publish() function. Applications that specify segment IDs require a reserved range of segment IDs to use. To reserve a range of segment IDs, use rsm_get_segmentid_range and define the reserved range of segment IDs in the segment ID configuration file /etc/rsm/rsm.segmentid. The rsm_get_segmentid_range function can be used by applications to obtain the segment ID range that is reserved for the applications. This function reads the segment ID range defined in the /etc/rsm/rsm.segmentid file for a given application ID.

An application ID is a null-terminated string that identifies the application. The application can use any value equal to or greater than baseid and less than baseid+length. If baseid or length are modified, the segment ID returned to the application might be outside the reserved range. To avoid this problem, use an offset within the range of reserved segment IDs to obtain a segment ID.

Entries in the /etc/rsm/rsm.segmentid file are of the form:


#keyword      appid      baseid       length
reserve       SUNWfoo    0x600000     100

The entries are composed of strings, which can be separated by tabs or blanks. The first string is the keyword reserve, followed by the application identifier, which is a string without spaces. Following the application identifier is the baseid, which is the starting segment ID of the reserved range in hexadecimal. Following the baseid is the length, which is the number of segment IDs that are reserved. Comment lines have a # in the first column. The file should not contain blank or empty lines. Segment IDs that are reserved for the system are defined in the /usr/include/rsm/rsm_common.h header file. The segment IDs that are reserved for the system cannot be used by the applications.

The rsm_get_segmentid_range function returns 0 to indicate success. If the function fails, the function returns one of the following error values:

RSMERR_BAD_ADDR

The address that is passed is invalid

RSMERR_BAD_APPID

Application ID not defined in the/etc/rsm/rsm.segmentid file

RSMERR_BAD_CONF

The configuration file /etc/rsm/rsm.segmentid is not present or not readable. The file format's configuration is incorrect