Kernel Functions for Drivers ldigetdev(9F)
NAME
ldigetdev, ldigetotyp, ldigetdevid, ldigetminorname
- Extract information from a layered handle
SYNOPSIS
#include
int ldigetdev(ldihandlet lh, devt *devp);
int ldigetotyp(ldihandlet lh, int *otyp);
int ldigetdevid(ldihandlet lh, ddidevidt *devid);
int ldigetminorname(ldihandlet lh, char **minorname);
PARAMETERS
lh Layered handle
otyp Indicates on which interface the driver was
opened. Valid settings are:
OTYPBLK Open device block interface.
OTYPCHR Open device character interface.
devp Pointer to a device number.
devid Device ID.
minorname Minor device node name.
DESCRIPTION
The ldigetdev() function retrieves the devt associated
with a layered handle.
The ldigetotyp() retrieves the open flag that was used to
open the device associated with the layered handle.
SunOS 5.11 Last change: 3 June 2003 1
Kernel Functions for Drivers ldigetdev(9F)
The ldigetdevid() function retrieves a devid for the dev-
ice associated with the layered handle. The caller should
use ddidevidfree() to free the devid when done with it.
The ldigetminorname() function retrieves the name of the
minor node opened for the device associated with the layered
handle. ldigetminorname() allocates a buffer containing
the minor node name and returns it via the minorname param-
eter. The caller should use kmemfree() to release the
buffer when done with it.
RETURN VALUES
The ldigetdev(), ldigetotyp(), ldigetdevid(), and
ldigetdevid() functions return 0 upon success.
In case of an error, the following values may be returned:
EINVAL Invalid input parameters.
ENOTSUP The operation is not supported for this device.
CONTEXT
These functions may be called from user or kernel context.
SunOS 5.11 Last change: 3 June 2003 2
|