genmajor Device Configuration Subroutine

Purpose

Generates the next available major number for a device driver instance.

Syntax

#include <cf.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>
int genmajor ( device_driver_instance_name)
char *device_driver_instance_name;

Parameters

Item Description
device_driver_instance_name Points to a character string containing the device driver instance name.

Description

The genmajor device configuration subroutine is one of the routines designated for accessing the Customized Device Driver (CuDvDr) object class. If a major number already exists for the given device driver instance, it is returned. Otherwise, a new major number is generated.

The genmajor subroutine creates an entry (object) in the CuDvDr object class for the major number information. The lowest available major number or the major number that has already been allocated is returned. The CuDvDr object class is locked exclusively by this routine until its completion.

Return Values

If the genmajor subroutine executes successfully, a major number is returned. This major number is either the lowest available major number or the major number that has already been allocated to the device instance.

A value of -1 is returned if the genmajor subroutine fails.

Files

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