1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / makedev.3c
blobe2209e9f9ef907e05c2b6ba3578dc4b8933e0a1a
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH MAKEDEV 3C "Dec 29, 1996"
7 .SH NAME
8 makedev, major, minor \- manage a device number
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/types.h>
13 #include <sys/mkdev.h>
15 \fBdev_t\fR \fBmakedev\fR(\fBmajor_t\fR \fImaj\fR, \fBminor_t\fR \fImin\fR);
16 .fi
18 .LP
19 .nf
20 \fBmajor_t\fR \fBmajor\fR(\fBdev_t\fR \fIdevice\fR);
21 .fi
23 .LP
24 .nf
25 \fBminor_t\fR \fBminor\fR(\fBdev_t\fR \fIdevice\fR);
26 .fi
28 .SH DESCRIPTION
29 .sp
30 .LP
31 The \fBmakedev()\fR function returns a formatted device number on success and
32 \fBNODEV\fR on failure.  The \fImaj\fR argument is the major number.  The
33 \fImin\fR argument is the minor number.  The \fBmakedev()\fR function can be
34 used to create a device number for input to \fBmknod\fR(2).
35 .sp
36 .LP
37 The \fBmajor()\fR function returns the major number component from
38 \fIdevice\fR.
39 .sp
40 .LP
41 The \fBminor()\fR function returns the minor number component  from
42 \fIdevice\fR.
43 .SH RETURN VALUES
44 .sp
45 .LP
46 Upon successful completion, \fBmakedev()\fR returns a formatted device number.
47 Otherwise, \fBNODEV\fR is returned and \fBerrno\fR is set to indicate the
48 error.
49 .SH ERRORS
50 .sp
51 .LP
52 The \fBmakedev()\fR function will fail if:
53 .sp
54 .ne 2
55 .na
56 \fB\fBEINVAL\fR\fR
57 .ad
58 .RS 10n
59 One or both of the arguments \fImaj\fR and \fImin\fR is too large, or the
60 \fIdevice\fR number created from \fImaj\fR and \fImin\fR is \fBNODEV\fR.
61 .RE
63 .sp
64 .LP
65 The \fBmajor()\fR function will fail if:
66 .sp
67 .ne 2
68 .na
69 \fB\fBEINVAL\fR\fR
70 .ad
71 .RS 10n
72 The \fIdevice\fR argument is \fBNODEV\fR, or the major number component of
73 \fIdevice\fR is too large.
74 .RE
76 .sp
77 .LP
78 The \fBminor()\fR function will fail if:
79 .sp
80 .ne 2
81 .na
82 \fB\fBEINVAL\fR\fR
83 .ad
84 .RS 10n
85 The \fIdevice\fR argument is \fBNODEV\fR.
86 .RE
88 .SH ATTRIBUTES
89 .sp
90 .LP
91 See \fBattributes\fR(5) for descriptions of the following attributes:
92 .sp
94 .sp
95 .TS
96 box;
97 c | c
98 l | l .
99 ATTRIBUTE TYPE  ATTRIBUTE VALUE
101 MT-Level        MT-Safe
104 .SH SEE ALSO
107 \fBmknod\fR(2), \fBstat\fR(2), \fBattributes\fR(5)