xref: /freebsd/sbin/mknod/mknod.8 (revision 21b4c1da95795f81d9f3c2f2742783dda9d287d4)
18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
128fae3551SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
138fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
148fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
158fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
178fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
188fae3551SRodney W. Grimes.\"    without specific prior written permission.
198fae3551SRodney W. Grimes.\"
208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308fae3551SRodney W. Grimes.\" SUCH DAMAGE.
318fae3551SRodney W. Grimes.\"
328fae3551SRodney W. Grimes.\"     @(#)mknod.8	8.2 (Berkeley) 12/11/93
337f3dea24SPeter Wemm.\" $FreeBSD$
348fae3551SRodney W. Grimes.\"
358fae3551SRodney W. Grimes.Dd December 11, 1993
368fae3551SRodney W. Grimes.Dt MKNOD 8
379fe48c6eSRuslan Ermilov.Os
388fae3551SRodney W. Grimes.Sh NAME
398fae3551SRodney W. Grimes.Nm mknod
408fae3551SRodney W. Grimes.Nd build special file
418fae3551SRodney W. Grimes.Sh SYNOPSIS
427c7fb079SRuslan Ermilov.Nm
438fae3551SRodney W. Grimes.Ar name
448fae3551SRodney W. Grimes.Op Cm c | Cm b
458fae3551SRodney W. Grimes.Ar major minor
461252c1bbSRuslan Ermilov.Op Ar owner : Ns Ar group
478fae3551SRodney W. Grimes.Sh DESCRIPTION
488fae3551SRodney W. GrimesThe
497c7fb079SRuslan Ermilov.Nm
50e1205e80SPhilippe Charnierutility creates device special files.
518fae3551SRodney W. GrimesNormally the shell script
528fae3551SRodney W. Grimes.Pa /dev/MAKEDEV
538fae3551SRodney W. Grimesis used to create special files for commonly known devices; it executes
54fbb3447fSPhilippe Charnier.Nm
558fae3551SRodney W. Grimeswith the appropriate arguments and can make all the files required for the
568fae3551SRodney W. Grimesdevice.
578fae3551SRodney W. Grimes.Pp
588fae3551SRodney W. GrimesTo make nodes manually, the four required arguments are:
598fae3551SRodney W. Grimes.Pp
60fbb3447fSPhilippe Charnier.Bl -tag -width indent
618fae3551SRodney W. Grimes.It Ar name
628fae3551SRodney W. GrimesDevice name, for example
638fae3551SRodney W. Grimes.Dq sd
648fae3551SRodney W. Grimesfor a SCSI disk on an HP300 or a
658fae3551SRodney W. Grimes.Dq pty
6621b4c1daSRuslan Ermilovfor pseudo-terminals.
678fae3551SRodney W. Grimes.It Cm b | Cm c
68ef8f7ac9SSheldon HearnType of device.
69ef8f7ac9SSheldon HearnIf the
708fae3551SRodney W. Grimesdevice is a block type device such as a tape or disk drive which needs
718fae3551SRodney W. Grimesboth cooked and raw special files,
728fae3551SRodney W. Grimesthe type is
738fae3551SRodney W. Grimes.Cm b .
748fae3551SRodney W. GrimesAll other devices are character type devices, such as terminal
758fae3551SRodney W. Grimesand pseudo devices, and are type
768fae3551SRodney W. Grimes.Cm c .
778fae3551SRodney W. Grimes.It Ar major
788fae3551SRodney W. GrimesThe major device number is an integer number which tells the kernel
798fae3551SRodney W. Grimeswhich device driver entry point to use.  To learn what
8076b363a6SDima Dorfmanmajor device number to use for a particular device, check
818fae3551SRodney W. Grimes.Pa /dev/MAKEDEV
8276b363a6SDima Dorfmanor
8376b363a6SDima Dorfman.Pa /usr/src/sys/conf/majors .
848fae3551SRodney W. Grimes.It Ar minor
858fae3551SRodney W. GrimesThe minor device number tells the kernel which subunit
868fae3551SRodney W. Grimesthe node corresponds to on the device; for example,
878fae3551SRodney W. Grimesa subunit may be a file system partition
888fae3551SRodney W. Grimesor a tty line.
891252c1bbSRuslan Ermilov.It Ar owner : Ns Ar group
902dc15252SDavid E. O'BrienThe
912dc15252SDavid E. O'Brien.Ar owner
922dc15252SDavid E. O'Brien.Ar group
932dc15252SDavid E. O'Brienoperand pair is optional, however, if one is specified, they both must be
942dc15252SDavid E. O'Brienspecified.
952dc15252SDavid E. O'BrienThe
962dc15252SDavid E. O'Brien.Ar owner
972dc15252SDavid E. O'Brienmay be either a numeric user ID or a user name.
982dc15252SDavid E. O'BrienIf a user name is also a numeric user ID, the operand is used as a
992dc15252SDavid E. O'Brienuser name.
1002dc15252SDavid E. O'BrienThe
1012dc15252SDavid E. O'Brien.Ar group
1022dc15252SDavid E. O'Brienmay be either a numeric group ID or a group name.
103d105b18bSMike PritchardSimilar to the user name,
1042dc15252SDavid E. O'Brienif a group name is also a numeric group ID, the operand is used as a
1052dc15252SDavid E. O'Briengroup name.
1068fae3551SRodney W. Grimes.El
107ce6bb537SJoerg Wunsch.Pp
1086ee990e0SBruce EvansMajor and minor device numbers can be given in any format acceptable to
1096ee990e0SBruce Evans.Xr strtoul 3 ,
1106ee990e0SBruce Evansso that a leading
111ce6bb537SJoerg Wunsch.Ql 0x
112ce6bb537SJoerg Wunschindicates a hexadecimal number, and a leading
113ce6bb537SJoerg Wunsch.Ql 0
114ce6bb537SJoerg Wunschwill cause the number to be interpreted as octal.
1152dc15252SDavid E. O'Brien.Sh COMPATIBILITY
1162dc15252SDavid E. O'BrienThe
117a697e022SDima Dorfman.Xr chown 8 Ns - Ns
1182dc15252SDavid E. O'Brienlike functionality is specific to
1192dc15252SDavid E. O'Brien.Fx
1202dc15252SDavid E. O'Brienand was added so that
1212dc15252SDavid E. O'Brien.Pa /dev/MAKEDEV
122a697e022SDima Dorfmanwould not depend on
1232dc15252SDavid E. O'Brien.Pa /usr
1242dc15252SDavid E. O'Brienbeing mounted.
1258fae3551SRodney W. Grimes.Sh SEE ALSO
12621eab473SDavid E. O'Brien.Xr mkfifo 1 ,
1278fae3551SRodney W. Grimes.Xr mknod 2 ,
1285521ff5aSRuslan Ermilov.Xr chown 8 ,
1295521ff5aSRuslan Ermilov.Xr MAKEDEV 8
1308fae3551SRodney W. Grimes.Sh HISTORY
1318fae3551SRodney W. GrimesA
1328fae3551SRodney W. Grimes.Nm
133e1205e80SPhilippe Charnierutility appeared in
1340f778506SMike Pritchard.At v6 .
135