Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1980, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)mknod.8 6.4 (Berkeley) 3/16/91 | |
33 | .\" | |
34 | .Dd March 16, 1991 | |
35 | .Dt MKNOD 8 | |
36 | .Os BSD 4 | |
37 | .Sh NAME | |
38 | .Nm mknod | |
39 | .Nd build special file | |
40 | .Sh SYNOPSIS | |
41 | .Nm mknod | |
42 | .Ar name | |
43 | .Op Cm c | Cm b | |
44 | .Ar major minor | |
45 | .Sh DESCRIPTION | |
46 | The | |
47 | .Nm mknod | |
48 | command creates device special files. | |
49 | Normally the shell script | |
50 | .Pa /dev/MAKEDEV | |
51 | is used to create special files for commonly known devices; it executes | |
52 | .Nm mknod | |
53 | with the appropriate arguments and can make all the files required for the | |
54 | device. | |
55 | .Pp | |
56 | To make nodes manually, the four required arguments are: | |
57 | .Pp | |
58 | .Bl -tag -width majorx | |
59 | .It Ar name | |
60 | Device name, for example | |
61 | .Dq sd | |
62 | for a SCSI disk on an HP300 or a | |
63 | .Dq pty | |
64 | for pseudo-devices. | |
65 | .It Cm b | Cm c | |
66 | Type of device. If the | |
67 | device is a block type device such as a tape or disk drive which needs | |
68 | both cooked and raw special files, | |
69 | the type is | |
70 | .Cm b . | |
71 | All other devices are character type devices, such as terminal | |
72 | and psuedo devices, and are type | |
73 | .Cm c . | |
74 | .It Ar major | |
75 | The major device number is an integer number which tells the kernel | |
76 | which device driver entry point to use. To learn what | |
77 | major device number to use for a particular device, check the file | |
78 | .Pa /dev/MAKEDEV | |
79 | to see if the device is known, or check | |
80 | the system dependent device configuration file: | |
81 | .Bd -filled -offset indent | |
82 | .Dq Pa /usr/src/sys/conf/device. Ns Em architecture | |
83 | .Ed | |
84 | .Pp | |
85 | (for example | |
86 | .Pa device.hp300 ) . | |
87 | .It Ar minor | |
88 | The minor device number tells the kernel which subunit | |
89 | the node corresponds to on the device; for example, | |
90 | a subunit may be a filesystem partition | |
91 | or a tty line. | |
92 | .El | |
93 | .Sh SEE ALSO | |
94 | .Xr mknod 2 , | |
95 | .Xr makedev 8 | |
96 | .Sh HISTORY | |
97 | A | |
98 | .Nm | |
99 | command appeared in Version 6 AT&T UNIX. |