xref: /illumos-gate/usr/src/man/man9f/ldi_get_size.9f (revision 6446bd46ed1b4e9f69da153665f82181ccaedad5)
te
Copyright (c) 2004, 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]
LDI_GET_SIZE 9F "Mar 18, 2004"
NAME
ldi_get_size - Retrieve device size
SYNOPSIS

#include <sys/sunldi.h>

int ldi_get_size(ldi_handle_t lh, uint64_t *sizep);
PARAMETERS
lh

Layered handle.

sizep

Pointer to the caller's unsigned 64-bit integer buffer.

DESCRIPTION

The ldi_get_size() function uses the layered driver handle to calculate and return a device's size. The device size is returned within the caller supplied buffer (*sizep). A valid layered driver handle must be obtained via the ldi_open_by_name(9F) interface prior to calling ldi_get_size().

RETURN VALUES

The ldi_get_size() function returns the following values: DDI_SUCCESS

The device size has been returned within the caller supplied buffer.

DDI_FAILURE

The device size could not be found or determined.

CONTEXT

This function may be called from user or kernel context.

SEE ALSO

ldi_open_by_name (9F)

Writing Device Drivers