DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

major(D3oddi)


major, makedev, minor -- return base major, new device number, or extended minor device number

Synopsis

#include <sys/sysmacros.h>
#include <sys/types.h>

int major(dev_t dev);

dev_t makedev(int major, int minor);

int minor(dev_t dev);

Description

The major macro returns the base major device number for device number dev. Use emajor to return the external (real) major device number.

The makedev macro returns a new device number for base major number major and extended minor device number minor.

The minor macro returns the extended minor device number for device number dev.

Arguments


dev
Device number of type dev_t that contains both the major and minor device numbers.

major
Base major number.

minor
Extended minor number.

Return values

major returns the base major device number and minor returns the extended minor device number for device number dev.

makedev returns a new device number for the specified base major number and extended minor device number.

Usage

Beginning with SCO OpenServer (ODDI version 3) major( ), makedev( ), and minor( ) support extended minor device numbers (minor device numbers greater than 255). The base major device number and extended minor device number for a device have a one-to-one correspondence with the real (external) major and minor device numbers (defined in mdevice(F)). This effectively removes the former limit on the number of devices that a device driver can allocate to an adapter.

Use emajor(D3oddi) and eminor(D3oddi) to return the real major and minor numbers associated with device number dev.

Context and synchronization

All contexts.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

Differences between versions

Extended major and minor numbers are not supported for SCO UNIX releases prior to SCO OpenServer. Device drivers that do not need extended minor numbers and that are required to install in the 3.2v2 kernel must be compiled with the -D_COMPAT322 option to avoid the undefined symbols xdevmap, nxdevmaps, and xdevtodev when linking.

SVR5 DDI compatibility

DDI drivers do not support these functions. For DDI versions prior to version 8, use the getmajor(D3) function in place of major( ), the getminor(D3) function in place of minor( ), and the makedevice(D3) function in place of makedev( ).

DDI 8 and later versions use the channel and instance number rather than major and minor numbers. See ``Channel number'' in HDK Technical Reference, ``Device instance'' in HDK Technical Reference, and ``Device number'' in HDK Technical Reference for more information.

References

emajor(D3oddi), eminor(D3oddi), mdevice(F)

``Device number'' in HDK Technical Reference, ``Major and minor numbers'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005