Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

minor(3) [netbsd man page]

MAKEDEV(3)						   BSD Library Functions Manual 						MAKEDEV(3)

makedev, major, minor -- device number conversion SYNOPSIS
#include <sys/types.h> dev_t makedev(int major, int minor); int major(dev_t dev); int minor(dev_t dev); DESCRIPTION
The makedev() macro allows a unique device number to be generated based on its major and minor number. The major() and minor() macros can be used to obtain the original numbers from the device number dev. All block and character devices are uniquely identified by a pair of major and minor numbers. The major number refers to a certain device class (e.g. disks, TTYs) while the minor number identifies an instance within the device class. RETURN VALUES
The major() macro returns a device major number that has a value between 0 and 255. The minor() macro returns a device minor number whose value can span the complete range of an int. SEE ALSO
mknod(2), devname(3), MAKEDEV(8) BSD
April 1, 2011 BSD

Check Out this Related Man Page

MAKEDEV(3)						     Linux Programmer's Manual							MAKEDEV(3)

makedev, major, minor - manage a device number SYNOPSIS
#define _BSD_SOURCE #include <sys/types.h> dev_t makedev(int maj, int min); int major(dev_t dev); int minor(dev_t dev); DESCRIPTION
A device ID consists of two parts: a major ID, identifying the class of the device, and a minor ID, identifying a specific instance of a device in that class. A device ID is represented using the type dev_t. Given major and minor device IDs, makedev() combines these to produce a device ID, returned as the function result. This device ID can be given to mknod(2), for example. The major() and minor() functions perform the converse task: given a device ID, they return, respectively, the major and minor components. These macros can be useful to, for example, decompose the device IDs in the structure returned by stat(2). CONFORMING TO
The makedev() major() and minor() functions are not specified in POSIX.1, but are present on many other systems. NOTES
These interfaces are defined as macros. Since glibc 2.3.3, they have been aliases for three GNU-specific functions: gnu_dev_makedev(3), gnu_dev_major(3), and gnu_dev_minor(3). The latter names are exported, but the traditional names are more portable. SEE ALSO
mknod(2), stat(2) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at Linux 2008-12-01 MAKEDEV(3)
Man Page

14 More Discussions You Might Find Interesting

1. Solaris

major & minor number

Hi Can anyone tell me what is major number and minor number in the mknod command. Also what these numbers mean. I have gone through the man pages but still I couldn't understand. Regards (3 Replies)
Discussion started by: RajaRC
3 Replies

2. Post Here to Contact Site Administrators and Moderators

minor issue on question that i had posted !!

to the moderators of this site... i posted a question several weeks ago about a egep -e if you look through my posts you will see that my question was fully plausible as a reasonable post that could have been answered even it was to say that I should search the man pages myself and find the... (4 Replies)
Discussion started by: moxxx68
4 Replies

3. Shell Programming and Scripting

sort major.minor.release_build_x

would like to order this input based on major.minor.release AND build number Label abc_def_0.0.3_build_999 2008/08/01 'Created by me.' Label abc_def_0.0.9_build_1000 2008/08/01 'Created by me.' Label abc_def_9.0.9_build_10001 2008/08/01 'Created by me.' Label abc_def_10.9.100_build_2... (4 Replies)
Discussion started by: gurpal2000
4 Replies

4. UNIX for Dummies Questions & Answers

How to suppress minor C compiler warnings

Hi, I develop code using a few different solaris platforms. I've recently moved to SunOS 5.10 using the following c compiler. Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25 On this box and these versions I get hundreds of warnings that do not appear of the earlier solaris/c versions. ... (4 Replies)
Discussion started by: speedos82
4 Replies

5. Solaris

Help with Major and minor number

Hi Does anyone know what the major and minor numbers are in Solaris? (2 Replies)
Discussion started by: wisdom
2 Replies

6. AIX

how do I change major-minor numbers of disk devices

Good evening ... does anyone of you know how to change major/minor numbers of disk devices ? I had to migrate from raid1 to raid5 and this messed up my ASM cluster - I know which devices should have which IDs to match the content - but I have no idea how to change it. Any help would be... (2 Replies)
Discussion started by: zxmaus
2 Replies

7. AIX

Difference between Major and Minor in AIX

Difference between Major and Minor in AIX (5 Replies)
Discussion started by: AIXlearner
5 Replies

8. Programming

which head file for major and minor function?

#include <sys/types.h> #include <sys/stat.h> #include <sys/termios.h> #include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <string.h> #include <unistd.h> #include <signal.h> #include <sys/mkdev.h> int main(int argc, char *argv) { int i; struct stat buf; ... (4 Replies)
Discussion started by: konvalo
4 Replies

9. Shell Programming and Scripting

How to filter out major and minor?

Hi, I have line like this : proj_name/module/trunk/module_1_0 where the first "1" refers to major version and second "0" refers to minor version. any AWK or command like that so that I can filter out the major and minor ? like major= command | input line minor= command |... (4 Replies)
Discussion started by: bhaskar_m
4 Replies

10. Solaris

Minor (I hope!) Crisis - E450 will not power up

UNIX Friends, Came in this morning to a downed E450 - thought it had been a power disaster. But wasn't! Machine had apparently shut itself down. All three power supplies are double-green, and case interlock switch is closed... As this is the first time we've had such a catastrophic(?)... (5 Replies)
Discussion started by: Dr Lou
5 Replies

11. Solaris

Boot failure - Warnings for /etc/major_to_minor and /etc/driver_aliases

Got a problem booting my Solaris 2.7 machine. Get pages and pages of error messages complaining about invalid line 2 in /etc/major_to_minor and then a few pages complaining about errors in /etc/driver_aliases. Then it aborts with an MMU error and kicks back to OK> prompt. Managed to boot... (10 Replies)
Discussion started by: psychocandy
10 Replies

12. Fedora

sftp Unspecified GSS failure Minor code may provide more information No credentials cache found

Hi I have managed on numerous machine to set up sftp not too require a password - i finally have one that does not work and Im at a loss - looked around checked permissions etc The 2 machines Ill call then source and target I need to sftp from source to target (previously the target has... (3 Replies)
Discussion started by: wwwdaryl
3 Replies

13. Solaris

Major and Minor number of Virtual File System

Hi friends, Please let me know if there is any way to find out Major and Minor numbers of virtual file system like below: /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K ... (8 Replies)
Discussion started by: nitj
8 Replies

14. Shell Programming and Scripting

Filtering my major and minor values

I want to remove all rows with a minor repeating count less than 30% compared to the major repeating count from my table. The values of a col(starting col 2) can assume is A,T,G,C and N. Each row has at least 2 values and at most 4 repeating values(out of ATGC). N is considered a missing value... (12 Replies)
Discussion started by: newbie83
12 Replies