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

2004/01/07 minor number


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


Got something to add? Send me email.





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

Printer Friendly Version

->
-> minor number


Inexpensive and informative Apple related e-books:

iOS 10: A Take Control Crash Course

Take Control of High Sierra

Photos for Mac: A Take Control Crash Course

Take Control of OS X Server

Sierra: A Take Control Crash Course




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





May you live long enough to regret your opinions - (Tony Lawrence)




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





SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)
www.SCOsales.com