Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

major(3) [suse man page]

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

NAME
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 http://www.kernel.org/doc/man-pages/. Linux 2008-12-01 MAKEDEV(3)

Check Out this Related Man Page

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

NAME
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 http://www.kernel.org/doc/man-pages/. Linux 2008-12-01 MAKEDEV(3)
Man Page

11 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. UNIX for Dummies Questions & Answers

head & tail

I've a major file which includes other files and now I wanna 'cut' the file in several minor parts....like .... find / -name "*.tmp" >filea wc -l filea >fileb sed -e '1s/ filea//' fileb >filec AMOUNT=`cat filec` if ; then cat file a |head -100l (ell) |tail -100l >filec cat file a |head... (6 Replies)
Discussion started by: svennie
6 Replies

3. UNIX for Dummies Questions & Answers

How to reuse same major number

Hi, I am working on device drivers.Once If register a device i'll get one major no. If i unregister and register again i'll get a different major no.What i have to do to get same major no. each time :( (0 Replies)
Discussion started by: Agnello
0 Replies

4. HP-UX

recreating /dev/null

Something (I'm still trying to find out what) has clobbered our /dev/null and made it into an ordinary file. I know I need to recreate it with mknod, but I'm unsure what the major and minor device numbers should be - I know enough to know that they vary on different systems and I've seen 1 3, 2 2,... (4 Replies)
Discussion started by: pblake1
4 Replies

5. 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

6. AIX

major no

hi what is meant by major no in vg what is meant by concurrent vg i cant understand these two things (3 Replies)
Discussion started by: senmak
3 Replies

7. UNIX for Dummies Questions & Answers

Which kind of UNIX to major investment banks use?

Hi, I would like to know what kind of UNIX major investment banks tend to use? I want to try to get a job with one of these places. By major, I mean big companies like Citigroup, JP Morgan Chase, Morgan Stanley, etc. Thanks. (5 Replies)
Discussion started by: rubrubber
5 Replies

8. News, Links, Events and Announcements

b8 development goes on

b8 development goes on The next b8 release (0.5) will be a major one with major changes. Oliver Lillie sent me a basic PHP 5 port of b8, I used his code as the base for b8 0.5. Almost all parts have been completely rewritten, only the math remains untouched. The most significant changes are:... (0 Replies)
Discussion started by: Neo
0 Replies

9. Shell Programming and Scripting

Incapsulating Functions

Hello together, I want to add 2 additional functions to a major function (format_work()). The format_work() is calling two functions (check_file() & split_file()). How should it look like, when both subfunctions are incapsulated? format_work() { echo "Start of COM_WORK... (2 Replies)
Discussion started by: Richardox
2 Replies

10. Shell Programming and Scripting

USING A PERL SCRIPT FOR BUCKETING N-GRAMS

I am trying to solve the issue of identifying names from the initials which are prefixed to it and are all conjoined. The prefixing can be of three major types. A single Letter prefixed: jsmith Two letters prefixed:jksmith Three letters prefixed:jkdsmith The algorithm which I had in mind was... (4 Replies)
Discussion started by: gimley
4 Replies

11. High Performance Computing

How can an EE major looking to get into HPC bolster their CS foundation?

Im a soph. EE major with an interest in applied mathematics looking to get into HPC and am looking for suggestions on where to start in terms of reading up on some CS subjects in order to get relatively rigorous understanding of whats really going on. For example im interested in parallel... (2 Replies)
Discussion started by: Harmonic
2 Replies