aboutsummaryrefslogtreecommitdiff
path: root/ja_JP.eucJP/man/man8/mknod.8
blob: 43e61235f6255ae20d5c360115731fafd0903794 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\" Copyright (c) 1980, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)mknod.8	8.2 (Berkeley) 12/11/93
.\"	%Id: mknod.8,v 1.7 1998/07/06 07:06:15 charnier Exp %
.\" jpman %Id: mknod.8,v 1.2 1997/03/31 13:37:12 horikawa Stab %
.\"
.Dd December 11, 1993
.Dt MKNOD 8
.Os BSD 4
.Sh 名称
.Nm mknod
.Nd スペシャルファイルを作成する
.Sh 書式
.Nm mknod
.Ar name
.Op Cm c | Cm b
.Ar major minor
.Sh 解説
.Nm
はデバイススペシャルファイルを作成します。通常、シェルスクリプト
.Pa /dev/MAKEDEV
で、よく知られているスペシャルファイルを作成することができます。
このスクリプトは、
.Nm
に適当な引数を渡して実行し、必要な全てのデバイスファイルの作成をします。
.Pp
.Nm
の引数としては、以下の 4 つが必要です。
.Bl -tag -width indent
.It Ar name
デバイスファイル名です。たとえば
.Dq sd
は SCSI ディスクで、
.Dq pty
は疑似デバイスです。
.It Cm b | Cm c
デバイスのタイプを指定します。
ブロック型のデバイスは、
.Cm b
を指定します。
テープやディスク等がこれに該当しますが、
ブロックスペシャルデバイス (cooked) とキャラクタスペシャルデバイス (raw) の
両方のスペシャルファイルが必要です。
キャラクタ型のデバイスは、
.Cm c
を指定します。
端末や疑似デバイス等がこれに該当します。
.It Ar major
メジャーデバイス番号を指定します。
メジャーデバイス番号は、
どのデバイスドライバエントリを使用すべきをカーネルに示します。
メジャーデバイス番号とデバイスの対応を知るには、
.Ar /dev/MAKEDEV 
を見てください。
.It Ar minor
マイナーデバイス番号を指定します。
マイナーデバイス番号は、
デバイスのどのサブユニットが
スペシャルファイルに対応するのかをカーネルに示します。
例えば、サブユニットは
ファイルシステムのパーティションだったり端末ラインだったりします。
.El
.Pp
メジャーデバイス番号およびマイナーデバイス番号とも
.Xr strtoul 3
が受け付ける任意の形式で指定可能です。
.Ql 0x
で始めることにより 16 進数と、
.Ql 0
で始めることにより 8 進数であると解釈させる事が出来ます。
.Sh 関連項目
.Xr mkfifo 1 ,
.Xr mknod 2 ,
.Xr MAKEDEV 8
.Sh 歴史
.Nm
コマンドは
.At v6
から登場しました。