xref: /illumos-gate/usr/src/man/man3rsm/rsm_memseg_export_publish.3rsm (revision d48be21240dfd051b689384ce2b23479d757f2d8)
te
Copyright (c) 2001 by Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
RSM_MEMSEG_EXPORT_PUBLISH 3RSM "Jun 8, 2001"
NAME
rsm_memseg_export_publish, rsm_memseg_export_unpublish, rsm_memseg_export_republish - allow or disallow a memory segment to be imported by other nodes
SYNOPSIS

cc [ flag... ] file... -lrsm [ library... ]
#include <rsmapi.h>

int rsm_memseg_export_publish(
 rsm_memseg_export_handle_t memseg,
 rsm_memseg_id_t *segment_id,
 rsmapi_access_entry_t access_list[],
 uint_t access_list_length);

int rsm_memseg_export_unpublish(
 rsm_memseg_export_handle_t memseg);

int rsm_memseg_export_republish(
 rsm_memseg_export_handle_t memseg,
 rsmapi_access_entry_t access_list[],
 uint_t access_list_length);
DESCRIPTION

The rsm_memseg_export_publish(), rsm_memseg_export_unpublish(), and rsm_memseg_export_republish() functions allow or disallow a memory segment to be imported by other nodes.

The rsm_memseg_export_publish(3RSM) function allows the export segment specified by the memseg argument to be imported by other nodes. It also assigns a unique segment identifier to the segment and defines the access control list for the segment. The segment_id argument is a pointer to an identifier which is unique on the publishing node. It is the responsibility of the application to manage the assignment of unique segment identifiers. The identifier can be optionally initialized to 0, in which case the system will return a unique segment identifier value. The access_list argument is composed of pairs of nodeid and access permissions. For each nodeid specified in the list, the associated read/write permissions are provided by three octal digits for owner, group, and other, as for Solaris file permissions. In the access control each octal digit may have the following values: 2

write access

4

read only access

6

read and write access

An access permissions value of 0624 specifies: (1) an importer with the same uid as the exporter has read and write access; (2) an importer with the same gid as the exporter has write access only; and (3) all other importers have read access only. When an access control list is provided, nodes not included in the list will be prevented from importing the segment. However, if the access list is NULL (this will require the length access_list_length to be specified as 0 as well), then no nodes will be excluded from importing and the access permissions on all nodes will equal the owner-group-other file creation permissions of the exporting process. Corresponding to the access_list argument, the access_list_length argument specifies the number of entries in the access_list array.

The rsm_memseg_export_unpublish() function disallows the export segment specified by memseg from being imported. All the existing import connections are forcibly disconnected.

The rsm_memseg_export_republish() function changes the access control list for the exported and published segment. Although the current import connections remain unaffected by this call, new connections are constrained by the new access list.

RETURN VALUES

Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error.

ERRORS

The rsm_memseg_export_publish(), rsm_memseg_export_unpublish(), and rsm_memseg_export_republish() functions can return the following errors: RSMERR_BAD_SEG_HNDL

Invalid segment handle.

RSMERR_NOT_CREATOR

Not creator of segment.

The rsm_memseg_export_publish() and rsm_memseg_export_republish() functions can return the following errors, with the exception that only rsm_memseg_export_publish() can return the errors related to the segment identifier: RSMERR_SEGID_IN_USE

Segment identifier in use.

RSMERR_RESERVED_SEGID

Segment identifier reserved.

RSMERR_BAD_SEGID

Invalid segment identifier.

RSMERR_BAD_ACL

Invalid access control list.

RSMERR_SEG_ALREADY_PUBLISHED

Segment already published.

RSMERR_INSUFFICIENT_MEM

Insufficient memory.

RSMERR_INSUFFICIENT_RESOURCES

Insufficient resources.

RSMERR_LOCKS_NOT_SUPPORTED

Locks not supported.

RSMERR_BAD_ADDR

Bad address.

The rsm_memseg_export_republish() and rsm_memseg_export_unpublish() functions can return the following errors: RSMERR_SEG_NOT_PUBLISHED

Segment not published.

RSMERR_INTERRUPTED

The operation was interrupted by a signal.

ATTRIBUTES

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Evolving
MT-Level MT-Safe
SEE ALSO

rsm_memseg_export_create (3RSM), attributes (7)

NOTES

An attempt to publish a segment might block until sufficient resources become available.