7139 Sync mDNS with mDNSResponder-625.41.2
[unleashed.git] / usr / src / man / man3rsm / rsm_get_segmentid_range.3rsm
blobd7708f796695f5872675ce24ca3412d2b773bacf
1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc.  All rights reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH RSM_GET_SEGMENTID_RANGE 3RSM "May 8, 2003"
7 .SH NAME
8 rsm_get_segmentid_range \- get segment ID range
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR... ] \fIfile\fR... -lrsm [ \fIlibrary\fR... ]
13 #include <rsmapi.h>
15 \fBint\fR \fBrsm_get_segmentid_range\fR(\fBconst char *\fR\fIappid\fR,
16      \fBrsm_memseg_id_t *\fR\fIbaseid\fR, \fBuint32_t *\fR\fIlength\fR);
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 RSM segment IDs can be either specified by the application or generated by the
23 system using the  \fBrsm_memseg_export_publish\fR(3RSM) function. Applications
24 that specify segment IDs require a reserved range of segment IDs that they can
25 use. This can be achieved by using \fBrsm_get_segmentid_range()\fR and by
26 reserving a range of segment IDs in the segment ID configuration file,
27 \fB/etc/rsm/rsm.segmentid\fR. The \fBrsm_get_segmentid_range()\fR function can
28 be used by applications to obtain the segment ID range reserved for them. The
29 \fIappid\fR argument is a null-terminated string that identifies the
30 application. The \fIbaseid\fR argument points to the location where the
31 starting segment ID of the reserved range is returned. The \fIlength\fR
32 argument points to the location where the number of reserved segment IDs is
33 returned.
34 .sp
35 .LP
36 The application can use any value starting at \fIbaseid\fR and less than
37 \fIbaseid\fR+\fIlength\fR. The application should use an offset within the
38 range of reserved segment IDs to obtain a segment ID such that if the
39 \fIbaseid\fR or \fIlength\fR is modified, it will still be within its reserved
40 range.
41 .sp
42 .LP
43 It is the responsibility of the system administrator to make sure that the
44 segment ID ranges are properly administered (such that they are
45 non-overlapping, the file on various nodes of the cluster have identical
46 entries, and so forth.) Entries in the \fB/etc/rsm/rsm.segmentid\fR file are of
47 the form:
48 .sp
49 .in +2
50 .nf
51 #keyword             appid    baseid    length
52 reserved     SUNWfoo  0x600000  1000
53 .fi
54 .in -2
55 .sp
57 .sp
58 .LP
59 The fields in the file are separated by tabs or blanks. The first string is a
60 keyword "reserve", followed by the application identifier (a string without
61 spaces), the baseid (the starting segment ID of the reserved range in
62 hexadecimal), and the length (the number of segmentids reserved). Comment lines
63 contain a "#" in the first column. The file should not contain blank or empty
64 lines. Segment IDs reserved for the system are defined in the
65 <\fB/usr/include/rsm/rsm_common.h\fR> header and cannot be used by the
66 applications.
67 .SH RETURN VALUES
68 .sp
69 .LP
70 Upon successful completion, these functions return 0. Otherwise, an error value
71 is returned to indicate the error.
72 .SH ERRORS
73 .sp
74 .LP
75 The \fBrsm_get_segmentid_range()\fR function can return the following errors:
76 .sp
77 .ne 2
78 .na
79 \fB\fBRSMERR_BAD_ADDR\fR \fR
80 .ad
81 .RS 21n
82 The address passed is invalid.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fBRSMERR_BAD_APPID\fR \fR
89 .ad
90 .RS 21n
91 The \fIappid\fR is not defined in configuration file.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fBRSMERR_BAD_CONF\fR \fR
98 .ad
99 .RS 21n
100 The configuration file is not present or not readable, or the configuration
101 file format is incorrect.
104 .SH ATTRIBUTES
107 See \fBattributes\fR(5) for descriptions of the following attributes:
112 box;
113 l | l
114 l | l .
115 ATTRIBUTE TYPE  ATTRIBUTE VALUE
117 Interface Stability     Unstable
119 MT-Level        MT-Safe
122 .SH SEE ALSO
125 \fBrsm_memseg_export_publish\fR(3RSM), \fBattributes\fR(5)