APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2004/01/07 minor number


Some material is very old and may be incorrect today

© January 2004 Tony Lawrence

Device files show up in long listings with two numbers where the size would ordinarily be:


crw-rw-rw-  1 root    wheel    1,   0 Jan  3 11:29 /dev/tty
crw--w----  1 pcunix  tty      5,   0 Jan  5 16:53 /dev/ttyp0
crw-rw-rw-  1 root    wheel    5,   1 Jan  3 12:48 /dev/ttyp1
crw-rw-rw-  1 root    wheel    5,   2 Jan  3 13:15 /dev/ttyp2
 

The first number is the major number for the device, and actually is simply an index into a table of memory addresses in your kernel. When you attempt to open /dev/tty, the kernel calls the code referenced by position one in its index. The second number (the minor number) is passed to that code as an argument.

The significance of the minor number is up to the code in the device driver. In the case of the ttyp* devices above, it is used to select which pseudo tty is being used. For a tape drive, it might indicate whether or not to rewind the tape before doing i/o.


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> minor number


Inexpensive and informative Apple related e-books:

Take Control of iCloud, Fifth Edition

Take Control of Preview

Take Control of High Sierra

Take Control of Pages

Take control of Apple TV, Second Edition





More Articles by © Tony Lawrence





Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us


Printer Friendly Version





I may not have gone where I intended to go, but I think I have ended up where I needed to be. (Douglas Adams)




Linux posts

Troubleshooting posts


This post tagged:

Kernel

UnixWords



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode