getminor Device Configuration Subroutine

Purpose

Gets the minor numbers associated with a major number from the Customized Device Driver (CuDvDr) object class.

Syntax

#include <cf.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>
int *getminor (major_no, how_many, device_instance)
int   major_no;
int *  how_many;
char *  device_instance;

Parameters

Item Description
major_no Specifies the major number for which the corresponding minor number or numbers is desired.
how_many Points to the number of minor numbers found corresponding to the major_no parameter.
device_instance Specifies a device instance name to use when searching for minor numbers. This parameter is used in conjunction with the major_no parameter.

Description

The getminor device configuration subroutine is one of the designated routines for accessing the CuDvDr object class. This subroutine queries the CuDvDr object class for the minor numbers associated with the given major number or device instance or both.

If the device_instance parameter is null, then only the major_no parameter is used to obtain the minor numbers. Otherwise, both the major_no and device_instance parameters should be used. The number of minor numbers found in the query is returned in the how_many parameter.

The CuDvDr object class is locked exclusively by the getminor subroutine for the duration of the routine.

The return value pointer points to a list that contains the minor numbers associated with the major number. This pointer is then used to move through the list to access each minor number. The minor numbers are returned in ascending sorted order.

The getminor subroutine also returns the number of minor numbers in the list to the calling routine in the how_many parameter.

Return Values

If the getminor routine fails, a null pointer is returned.

If the getminor subroutine succeeds, one of two possible values is returned. If no minor numbers are found, null is returned. In this case, the how_many parameter points to an integer value of 0. However, if minor numbers are found, then a pointer to a list of minor numbers is returned. The minor numbers are returned in ascending sorted order. In the latter case, the how_many parameter points to the number of minor numbers found.

Files

Item Description
/usr/lib/libcfg.a Archive of device configuration subroutines.