Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ldi_get_size.9f
blob6e235ae434d7d34daa224d7ad561a5ab999b208c
1 '\" te
2 .\"  Copyright (c) 2004, 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 LDI_GET_SIZE 9F "Mar 18, 2004"
7 .SH NAME
8 ldi_get_size \- Retrieve device size
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/sunldi.h>
14 \fBint\fR \fBldi_get_size\fR(\fBldi_handle_t\fR \fIlh\fR, \fBuint64_t *\fR\fIsizep\fR);
15 .fi
17 .SH PARAMETERS
18 .sp
19 .ne 2
20 .na
21 \fB\fIlh\fR \fR
22 .ad
23 .RS 10n
24 Layered handle.
25 .RE
27 .sp
28 .ne 2
29 .na
30 \fB\fIsizep\fR \fR
31 .ad
32 .RS 10n
33 Pointer to the caller's unsigned 64-bit integer buffer.
34 .RE
36 .SH DESCRIPTION
37 .sp
38 .LP
39 The \fBldi_get_size()\fR function uses the layered driver handle to calculate
40 and return a device's size. The device size is returned within the caller
41 supplied buffer (*\fIsizep\fR). A valid layered driver handle must be obtained
42 via the \fBldi_open_by_name\fR(9F) interface prior to calling
43 \fBldi_get_size()\fR.
44 .SH RETURN VALUES
45 .sp
46 .LP
47 The \fBldi_get_size()\fR function returns the following values:
48 .sp
49 .ne 2
50 .na
51 \fBDDI_SUCCESS\fR
52 .ad
53 .RS 15n
54 The device size has been returned within the caller supplied buffer.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fBDDI_FAILURE\fR
61 .ad
62 .RS 15n
63 The device size could not be found or determined.
64 .RE
66 .SH CONTEXT
67 .sp
68 .LP
69 This function may be called from user or kernel context.
70 .SH SEE ALSO
71 .sp
72 .LP
73 \fBldi_open_by_name\fR(9F)
74 .sp
75 .LP
76 \fIWriting Device Drivers\fR