1makedev(3C) Standard C Library Functions makedev(3C)
2
3
4
6 makedev, major, minor - manage a device number
7
9 #include <sys/types.h>
10 #include <sys/mkdev.h>
11
12 dev_t makedev(major_t maj, minor_t min);
13
14
15 major_t major(dev_t device);
16
17
18 minor_t minor(dev_t device);
19
20
22 The makedev() function returns a formatted device number on success and
23 NODEV on failure. The maj argument is the major number. The min argu‐
24 ment is the minor number. The makedev() function can be used to create
25 a device number for input to mknod(2).
26
27
28 The major() function returns the major number component from device.
29
30
31 The minor() function returns the minor number component from device.
32
34 Upon successful completion, makedev() returns a formatted device num‐
35 ber. Otherwise, NODEV is returned and errno is set to indicate the
36 error.
37
39 The makedev() function will fail if:
40
41 EINVAL One or both of the arguments maj and min is too large, or the
42 device number created from maj and min is NODEV.
43
44
45
46 The major() function will fail if:
47
48 EINVAL The device argument is NODEV, or the major number component
49 of device is too large.
50
51
52
53 The minor() function will fail if:
54
55 EINVAL The device argument is NODEV.
56
57
59 See attributes(5) for descriptions of the following attributes:
60
61
62
63
64 ┌─────────────────────────────┬─────────────────────────────┐
65 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
66 ├─────────────────────────────┼─────────────────────────────┤
67 │MT-Level │MT-Safe │
68 └─────────────────────────────┴─────────────────────────────┘
69
71 mknod(2), stat(2), attributes(5)
72
73
74
75SunOS 5.11 29 Dec 1996 makedev(3C)