OSDN Git Service

(split) LDP: Update drafts based on LDP v3.40.
[linuxjm/LDP_man-pages.git] / draft / man3 / makedev.3
1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\"*******************************************************************
25 .\"
26 .\" This file was generated with po4a. Translate the source file.
27 .\"
28 .\"*******************************************************************
29 .TH MAKEDEV 3 2010\-09\-10 Linux "Linux Programmer's Manual"
30 .SH 名前
31 makedev, major, minor \- manage a device number
32 .SH 書式
33 .nf
34 \fB#define _BSD_SOURCE\fP             /* See feature_test_macros(7) */
35 \fB#include <sys/types.h>\fP
36
37 \fBdev_t makedev(int \fP\fImaj\fP\fB, int \fP\fImin\fP\fB);\fP
38
39 \fBint major(dev_t \fP\fIdev\fP\fB);\fP
40 \fBint minor(dev_t \fP\fIdev\fP\fB);\fP
41
42 .fi
43 .SH 説明
44 A device ID consists of two parts: a major ID, identifying the class of the
45 device, and a minor ID, identifying a specific instance of a device in that
46 class.  A device ID is represented using the type \fIdev_t\fP.
47
48 Given major and minor device IDs, \fBmakedev\fP()  combines these to produce a
49 device ID, returned as the function result.  This device ID can be given to
50 \fBmknod\fP(2), for example.
51
52 The \fBmajor\fP()  and \fBminor\fP()  functions perform the converse task: given a
53 device ID, they return, respectively, the major and minor components.  These
54 macros can be useful to, for example, decompose the device IDs in the
55 structure returned by \fBstat\fP(2).
56 .SH 準拠
57 .\" The BSDs, HP-UX, Solaris, AIX, Irix
58 The \fBmakedev\fP(), \fBmajor\fP(), and \fBminor\fP()  functions are not specified in
59 POSIX.1, but are present on many other systems.
60 .SH 注意
61 These interfaces are defined as macros.  Since glibc 2.3.3, they have been
62 aliases for three GNU\-specific functions: \fBgnu_dev_makedev\fP(),
63 \fBgnu_dev_major\fP(), and \fBgnu_dev_minor\fP().  The latter names are exported,
64 but the traditional names are more portable.
65 .SH 関連項目
66 \fBmknod\fP(2), \fBstat\fP(2)
67 .SH この文書について
68 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
69 である。プロジェクトの説明とバグ報告に関する情報は
70 http://www.kernel.org/doc/man\-pages/ に書かれている。