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