Merge branch 'less_closed'
[unleashed.git] / usr / src / man / man3tsol / getdevicerange.3tsol
blobcec0f13f68ef048ee7909c445d89f537e5655d82
1 '\" te
2 .\" Copyright (c) 2007, 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 GETDEVICERANGE 3TSOL "Jul 20, 2007"
7 .SH NAME
8 getdevicerange \- get the label range of a device
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-lbsm\fR \fB-ltsol\fR [\fIlibrary\fR...]
13 .fi
15 .LP
16 .nf
17 #include <tsol/label.h>
19 \fBblrange_t *\fR\fBgetdevicerange\fR(\fBconst char *\fR\fIdevice\fR);
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBgetdevicerange()\fR function returns the label range of a
26 user-allocatable device.
27 .sp
28 .LP
29 If the label range is not specified for \fIdevice\fR, \fBgetdevicerange()\fR
30 returns the default values of \fBADMIN_LOW\fR for the lower bound and
31 \fBADMIN_HIGH\fR for the upper bound of \fIdevice\fR.
32 .sp
33 .LP
34 From the command line, \fBlist_devices\fR(1) can be used to see the label range
35 of \fIdevice\fR.
36 .SH RETURN VALUES
37 .sp
38 .LP
39 The \fBgetdevicerange()\fR function returns \fINULL\fR on failure and sets
40 \fIerrno\fR. On successful completion, it returns a pointer to a
41 \fBblrange_t\fR structure which must be freed by the caller, as follows:
42 .sp
43 .in +2
44 .nf
45 blrange_t *range;
46       ...
47       m_label_free(range->lower_bound);
48       m_label_free(range->upper_bound);
49       free(range);
50 .fi
51 .in -2
52 .sp
54 .SH ERRORS
55 .sp
56 .LP
57 The \fBgetdevicerange()\fR function will fail if:
58 .sp
59 .ne 2
60 .na
61 \fB\fBEAGAIN\fR\fR
62 .ad
63 .RS 11n
64 There is not enough memory available to allocate the required bytes. The
65 application could try later.
66 .RE
68 .sp
69 .ne 2
70 .na
71 \fB\fBENOMEM\fR\fR
72 .ad
73 .RS 11n
74 The physical limits of the system are exceeded by size bytes of memory which
75 cannot be allocated.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fBENOTSUP\fR\fR
82 .ad
83 .RS 11n
84 Invalid upper or lower bound for device.
85 .RE
87 .SH ATTRIBUTES
88 .sp
89 .LP
90 See \fBattributes\fR(5) for descriptions of the following attributes:
91 .sp
93 .sp
94 .TS
95 box;
96 c | c
97 l | l .
98 ATTRIBUTE TYPE  ATTRIBUTE VALUE
100 Interface Stability     Committed
102 MT-Level        MT-Safe
105 .SH SEE ALSO
108 \fBlist_devices\fR(1), \fBfree\fR(3C), \fBlibtsol\fR(3LIB),
109 \fBm_label_free\fR(3TSOL), \fBattributes\fR(5)
112 \fIValidating the Label Request Against the Printer\&'s Label Range\fR in
113 \fISolaris Trusted Extensions Developer\&'s Guide\fR
114 .SH NOTES
117 The functionality described on this manual page is available only if the system
118 is configured with Trusted Extensions.