[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 2

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>
long genmajor (device_driver_instance_name)
char *device_driver_instance_name;

Parameters

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

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

Related Information

The reldevno device configuration subroutine, relmajor device configuration subroutine.

List of ODM Commands and Subroutines in AIX General Programming Concepts: Writing and Debugging Programs.

Customized Device Driver (CuDvDr) object class.

List of Device Configuration Subroutines.


[ Previous | Next | Contents | Home | Search ]