05-23-2009
A quick search on "major and minor number" in google produces lots of result
major and minor number in unix - Google Search
or tip of info from my side
Quote:
The two numbers are stored in special file type, "character special" or
"block special" file. When that file is opened, the resulting file
descriptor is connected to the driver which is identified by the major
number. The minor number is simply an extra parameter that is passed to
the driver during the open, allowing multiple device files to refer to
the same driver, yet be distinguished from each other by that driver.
(The driver doesn't see the name which was used to open it: all it goes
by is the minor number). Minor numbers are a necessary flexibility,
making it possible for one driver to provide multiple device instances,
multiple behaviors for one device, or anything else that needs to be
distinguished: for instance logical partitions on a disk block device
9 More Discussions You Might Find Interesting
1. Programming
To further my fledgling knowledge of C, I am re-writing some of the Unix command set. My current command is an ls-style command.
All works well, except for device files. How do I get the major/minor numbers for the dev files?
I see from the stat struct there are st_rdev and st_dev members. Do... (1 Reply)
Discussion started by: zazzybob
1 Replies
2. Solaris
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
3. Shell Programming and Scripting
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. Solaris
Hi
Does anyone know what the major and minor numbers are in Solaris? (2 Replies)
Discussion started by: wisdom
2 Replies
5. AIX
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
6. Programming
#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
7. Shell Programming and Scripting
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
8. Solaris
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
9. Shell Programming and Scripting
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
LEARN ABOUT DEBIAN
autopush
autopush(1M) System Administration Commands autopush(1M)
NAME
autopush - configures lists of automatically pushed STREAMS modules
SYNOPSIS
autopush -f filename
autopush -g -M major -m minor
autopush -r -M major -m minor
DESCRIPTION
The autopush command configures the list of modules to be automatically pushed onto the stream when a device is opened. It can also be used
to remove a previous setting or get information on a setting.
OPTIONS
The following options are supported:
-f filename Sets up the autopush configuration for each driver according to the information stored in filename. An autopush file con-
sists of lines of four or more fields, separated by spaces as shown below:
major minor last-minor module1 module2 ... module8
The first field is a string that specifies the major device name, as listed in the /kernel/drv directory. The next two
fields are integers that specify the minor device number and last-minor device number. The fields following represent the
names of modules. If minor is -1, then all minor devices of a major driver specified by major are configured, and the value
for last-minor is ignored. If last-minor is 0, then only a single minor device is configured. To configure a range of minor
devices for a particular major, minor must be less than last-minor.
The remaining fields list the names of modules to be automatically pushed onto the stream when opened, along with the posi-
tion of an optional anchor. The maximum number of modules that can be pushed is eight. The modules are pushed in the order
they are specified. The optional special character sequence [anchor] indicates that a STREAMS anchor should be placed on
the stream at the module previously specified in the list; it is an error to specify more than one anchor or to have an
anchor first in the list.
A nonzero exit status indicates that one or more of the lines in the specified file failed to complete successfully.
-g Gets the current configuration setting of a particular major and minor device number specified with the -M and -m options
respectively and displays the autopush modules associated with it. It will also return the starting minor device number if
the request corresponds to a setting of a range (as described with the -f option).
-m minor Specifies the minor device number.
-M major Specifies the major device number.
-r Removes the previous configuration setting of the particular major and minor device number specified with the -M and -m
options respectively. If the values of major and minor correspond to a previously established setting of a range of minor
devices, where minor matches the first minor device number in the range, the configuration would be removed for the entire
range.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
EXAMPLES
Example 1: Using the autopush command.
The following example gets the current configuration settings for the major and minor device numbers as indicated and displays the autopush
modules associated with them for the character-special device /dev/term/a:
example# autopush -g -M 29 -m 0
Major Minor Lastminor Modules
29 0 1 ldterm ttcompat
FILES
/etc/iu.ap
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
bdconfig(1M), ttymon(1M), attributes(5), ldterm(7M), sad(7D), streamio(7I), ttcompat(7M)
STREAMS Programming Guide
SunOS 5.10 26 Mar 1999 autopush(1M)