getmajor man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

getmajor(9F)		 Kernel Functions for Drivers		  getmajor(9F)

NAME
       getmajor - get major device number

SYNOPSIS
       #include <sys/types.h>
       #include <sys/mkdev.h>
       #include <sys/ddi.h>

       major_t getmajor(dev_t dev);

INTERFACE LEVEL
       Architecture independent level 1 (DDI/DKI).

PARAMETERS
       dev	Device number.

DESCRIPTION
       The getmajor() function extracts the major number from a device number.

RETURN VALUES
       The major number.

CONTEXT
       The  getmajor()	function can be called from user, interrupt, or kernel
       context.

EXAMPLES
       Example 1: Using getmajor()

       The following example shows both the getmajor() and getminor(9F)	 func‐
       tions  used  in	a  debug cmn_err(9F) statement to return the major and
       minor numbers for the device supported by the driver.

	      dev_t dev;

	      #ifdef DEBUG
	      cmn_err(CE_NOTE,"Driver Started.	Major# = %d,
		   Minor# = %d", getmajor(dev), getminor(dev));
	      #endif

SEE ALSO
       cmn_err(9F), getminor(9F), makedevice(9F)

       Writing Device Drivers

WARNINGS
       No validity checking is performed. If dev is invalid, an invalid number
       is returned.

SunOS 5.10			  16 Jan 2006			  getmajor(9F)
[top]

List of man pages available for SunOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net