MAKEDEV(3) BSD Library Functions Manual MAKEDEV(3)NAME
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)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)
Hi Guys,
I want to execute few of my bash script, so that whenever someone calls shutdown now -r command, I want my script to execute first before shutting down.
Any help please?????
I've just started playing with the unix system, so far its been brilliant.... (10 Replies)
I'm trying to use the "mknod" call in C to create a clone of /dev/null. I am stumped as to the final parameter I should provide to "mknod()". I am supposed to give it a type dev_t, which specifies a major & minor number. I want to specify major 3, minor 1, but how can I do this?
dev_t seems to... (2 Replies)
hi,
accept() seems to be still blocking after socket is being closed on our Fedora 8 build. not sure if this is a common problem because i have never experienced this on any other platforms, however i have seen someone else having this issue on Redhat 7 and 9. so is there a socket option fedora... (10 Replies)
Hello all ,
i have change my system debian linux to freebsd( pcBSD)
all working as well , but the serial does not work correctly.
Under linux the problem does not appears.
my problem is than my serial port does work .
the first step than i have make is look with dmesg if my serial are... (0 Replies)
I know there is a thread on the subject but is not related to solaris so I am posting this question for help
I have a solaris 8 machine. I can log in through the console but when trying to log in through putty/telnet after accepting username and password it gives the follwing error
"Server... (2 Replies)
I have an application that's running curses on a weird linux environment... a lot of the base paths of stuff are non standard. But other screen applications run fine.
I've set TERMINFO_DIRS and gotten the ncurses application to run. Using a nonstandard terminfo path.
I see windows draw up... (5 Replies)
Our system is not booting up properly. It keeps going to this screen:
Enter Run Level (0-6, s or S):
I tried to hit all nos# 0-6 is just goes to hung state.
Tried s or S & it brings me to single user mode. I've checked the file systems & found out that all three had 98%. I tried to... (86 Replies)
Hi mates,
well before posting my problem, i really searched hi and low for some ideas, but sad to say none of them worked, including dd command.
My problem is that i have 2 harddisk, 1 in use and 1 for spare. The one im using got crashed and now im using my spare harddisk with all the... (24 Replies)
During installation of one of driver i needed to
Remove any earlier version drivers using
make clean -r command.
Where i m getting following error.
# make clean -r
Kernel source is not installed
make: *** Error 1
My kernel version
# uname -r
2.6.18-128.2.1.4.9.el5xen
Where... (4 Replies)
Hi,
I am using Ubuntu 8.04 64-bit (Hardy Heron LTS Desktop edition) OS on a 64-bit intel hardware (x86_64). I have wrongly renamed the /lib64/libdl-2.7.so shared library file and now hardly few commands are working. My Gnome UI display has gone and I could not establish any new connection via... (12 Replies)
Hi team,
I am new to unix,and need your advice on the below.
I am using aix5.3 and have installed make-3.82 on the server.
I need to use gmake for configuring and installing a package ,but it is giving error at the below
root@sapsrp:/usr/tmp/xymon-4.3.2
# ./configure.server
... (7 Replies)
Hi all,
I would like to use properly an input pipe, like this :
cat myFile.txt | myCommand.shI always find this solution :
while read line; do ...; donebut I have a great lost of performance !
On a big file, with a simple grep, I can spend 2400 times more time ! oO
(from 0,023sec to 1m)... (4 Replies)
Hi Guys,
OS:- Solaris 10 64Bit
I have a small query.
On one server a user is facing sed command issue.
He gets error regarding sed for this location
/users/hoy/2999/batch5/bin/internal.sh: /usr/local/bin/sed: not found
How ever the sed is actually present at this location on server:-... (13 Replies)
Hi,
Need a bit of help on this one as I am a scripting noob.
I have a linux based NAS that mounts USB hard drives in an inconsistent location and to make matters worse, seems to lose the mount for an unknown reason and doesn't remount automatically unless the drive is removed and re-inserted.... (4 Replies)