OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / release / man2 / ioctl.2
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 .\"     @(#)ioctl.2     6.4 (Berkeley) 3/10/91
33 .\"
34 .\" Modified 1993-07-23 by Rik Faith <faith@cs.unc.edu>
35 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
36 .\" Modified 1999-06-25 by Rachael Munns <vashti@dream.org.uk>
37 .\" Modified 2000-09-21 by Andries Brouwer <aeb@cwi.nl>
38 .\"
39 .\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya
40 .\"         all rights reserved.
41 .\" Translated Sat Aug 14 10:10:27 JST 1999
42 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
43 .\" Modified 2002-09-24 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
44 .\" Updated 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
45 .\"
46 .\"WORD:        device                  ¥Ç¥Ð¥¤¥¹
47 .\"WORD:        control                 À©¸æ¤¹¤ë
48 .\"WORD:        special                 ¥¹¥Ú¥·¥ã¥ë
49 .\"WORD:        character               ¥­¥ã¥é¥¯¥¿
50 .\"WORD:        parameter               ¥Ñ¥é¥á¡¼¥¿
51 .\"WORD:        operate                 Áàºî
52 .\"WORD:        open                    ¥ª¡¼¥×¥ó
53 .\"WORD:        request                 ¥ê¥¯¥¨¥¹¥È
54 .\"WORD:        descriptor              ¥Ç¥£¥¹¥¯¥ê¥×¥¿
55 .\"WORD:        argument                °ú¤­¿ô
56 .\"WORD:        encode                  ¥¨¥ó¥³¡¼¥É
57 .\"
58 .TH IOCTL 2 2000-09-21 "Linux" "Linux Programmer's Manual"
59 .SH Ì¾Á°
60 ioctl \- ¥Ç¥Ð¥¤¥¹ (device) ¤òÀ©¸æ¤¹¤ë
61 .SH ½ñ¼°
62 .B #include <sys/ioctl.h>
63 .sp
64 .BI "int ioctl(int " d ", int " request ", ...);"
65 .SH ÀâÌÀ
66 .BR ioctl ()
67 ´Ø¿ô¤Ï¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤ò¹½À®¤¹¤ë¥Ç¥Ð¥¤¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤ò
68 Áàºî¤¹¤ë¡£Æäˡ¢¥­¥ã¥é¥¯¥¿·¿¤Î¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë(Î㤨¤ÐüËö(terminal))
69 ¤Î¿¤¯¤ÎÁàºî²Äǽ¤ÊÆÃÀ­¤ò
70 .BR ioctl ()
71 ¥ê¥¯¥¨¥¹¥È¤Ë¤è¤Ã¤ÆÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£°ú¤­¿ô
72 .I d
73 ¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
74 .PP
75 2ÈÖÌܤΰú¤­¿ô¤Ï¡¢¥Ç¥Ð¥¤¥¹°Í¸¤Î¥ê¥¯¥¨¥¹¥È¡¦¥³¡¼¥É¤Ç¤¢¤ë¡£
76 3ÈÖÌܤΰú¤­¿ô¤Ï¡¢¥á¥â¥ê¤Ø¤Î·¿¤ò»ØÄꤷ¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
77 ¤³¤Î°ú¤­¿ô¤ÏÅÁÅýŪ¤Ë(C ¤Ç
78 .B "void *"
79 ¤¬Í­¸ú¤Ë¤Ê¤ëÁ°¤«¤é)
80 .BI "char *" argp
81 ¤Èɽµ­¤µ¤ì¤Æ¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Îʸ¾Ï¤Ç¤â¤½¤Î¤è¤¦¤Ë̾ÉÕ¤±¤ë¤³¤È¤È¤¹¤ë¡£
82 .PP
83 .BR ioctl ()
84 .I request
85 ¤Ë¤Ï¡¢°Ê²¼¤Î¾ðÊó¤ò¥Ð¥¤¥È¿ô¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë:
86 (1)°ú¤­¿ô¤¬
87 .I ÆþÎÏ
88 ¥Ñ¥é¥á¡¼¥¿¤«
89 .I ½ÐÎÏ
90 ¥Ñ¥é¥á¡¼¥¿¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¤«¡¢
91 (2)
92 .I argp
93 ¤ÎÂ礭¤µ¡£
94 .BR ioctl ()
95 .I request
96 ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Þ¥¯¥í(macro)¤ÈÄêµÁ¤Ï
97 .I <sys/ioctl.h>
98 ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡£
99 .SH ÊÖ¤êÃÍ
100 .BR ioctl ()
101 requests use the return value as an output parameter
102 ¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£
103 ¤¤¤¯¤Ä¤«¤Î
104 .BR ioctl ()
105 Í×µá¤Ç¤Ï½ÐÎϥѥé¥á¡¼¥¿¤È¤·¤ÆÊÖ¤êÃͤò»ÈÍѤ·¤Æ¤¤¤¿¤ê¡¢
106 À®¸ù¤·¤¿¾ì¹ç¤ËÈó 0 ¤ÎÃͤòÊÖ¤·¤¿¤ê¤¹¤ë¡£
107 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
108 .I errno
109 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
110 .SH ¥¨¥é¡¼
111 .TP 0.7i
112 .B EBADF
113 .I d
114 ¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£
115 .TP
116 .B EFAULT
117 .I argp
118 ¤¬¥¢¥¯¥»¥¹ÉÔ²Äǽ¤Ê¥á¥â¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£
119 .TP
120 .B EINVAL
121 .I request
122 ¤Þ¤¿¤Ï
123 .I argp
124 ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£
125 .TP
126 .B ENOTTY
127 .I d
128 ¤¬¥­¥ã¥é¥¯¥¿·¿¤Î¥¹¥Ú¥·¥ã¥ë¡¦¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
129 .TP
130 .B ENOTTY
131 »ØÄꤵ¤ì¤¿¥ê¥¯¥¨¥¹¥È¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿
132 .I d
133 ¤¬»²¾È¤¹¤ë¼ïÎà¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤ÏŬÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
134 .SH ½àµò
135 ¤É¤ì¤«°ì¤Ä¤Îɸ½à¤ËÂбþ¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£
136 .BR ioctl ()
137 ¤Î°ú¤­¿ô¡¢ÊÖ¤êÃÍ¡¢²ò¼á¤Ï¡¢½èÍýÂоݤΥǥХ¤¥¹¡¦¥É¥é¥¤¥Ð¤´¤È¤Ë
138 °Û¤Ê¤ë(¤³¤Î´Ø¿ô¤Ï UNIX ¤Î ¥¹¥È¥ê¡¼¥à I/O ¥â¥Ç¥ë ¤Ë
139 ÌÀ¤é¤«¤ËŬ¹ç¤·¤Ê¤¤ÍÍ¡¹¤ÊÁàºî¤Ë»ÈÍѤµ¤ì¤ë)¡£
140 ¤è¤¯ÃΤé¤ì¤Æ¤¤¤ë
141 .BR ioctl ()
142 ¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï
143 .BR ioctl_list (2)
144 ¤ò»²¾È¤¹¤ë¤³¤È¡£
145 .BR ioctl ()
146 ´Ø¿ô¥³¡¼¥ë¤Ï Version 7 AT&T UNIX ¤ÇÅо줷¤¿¡£
147 .SH Ãí°Õ
148 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬
149 ɬÍפǤ¢¤ë¡£¤·¤Ð¤·¤Ð
150 .BR open (2)
151 ¥³¡¼¥ë¤Ï˾¤ó¤Ç¤¤¤Ê¤¤ÉûºîÍѤòȼ¤¦¤³¤È¤¬¤¢¤ë¤¬¡¢Linux ¤Ç¤Ï
152 .BR open (2)
153 ¤Ë
154 .B O_NONBLOCK
155 ¥Õ¥é¥°¤ò¤Ä¤±¤ë¤³¤È¤Ç¤³¤ÎÉûºîÍѤòÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
156 .SH ´ØÏ¢¹àÌÜ
157 .BR execve (2),
158 .BR fcntl (2),
159 .BR ioctl_list (2),
160 .BR open (2),
161 .\" .BR mt (4),
162 .BR sd (4),
163 .BR tty (4)