OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / errno.3
1 .\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" 5 Oct 2002, Modified by Michael Kerrisk <mtk.manpages@gmail.com>
24 .\"     Updated for POSIX.1 2001
25 .\" 2004-12-17 Martin Schulze <joey@infodrom.org>, mtk
26 .\"     Removed errno declaration prototype, added notes
27 .\" 2006-02-09 Kurt Wall, mtk
28 .\"     Added non-POSIX errors
29 .\"
30 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
31 .\"     all rights reserved.
32 .\" Translated 1997-12-24, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
33 .\" Updated 1999-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
34 .\" Updated 1999-08-21, NAKANO Takeo <nakano@apm.seikei.ac.jp>
35 .\" Updated 2003-07-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" Updated 2005-03-15, Akihiro MOTOKI
37 .\" Updated 2006-02-15, Akihiro MOTOKI, Catch up to LDP v2.23
38 .\" Updated 2006-07-14, Akihiro MOTOKI, Catch up to LDP v2.34
39 .\" Updated 2008-08-07, Akihiro MOTOKI, Catch up to LDP v3.05
40 .\"
41 .TH ERRNO 3 2008-07-09 "" "Linux Programmer's Manual"
42 .\"O .SH NAME
43 .SH Ì¾Á°
44 .\"O errno \- number of last error
45 errno \- Ä¾¶á¤ËȯÀ¸¤·¤¿¥¨¥é¡¼¤ÎÈÖ¹æ
46 .\"O .SH SYNOPSIS
47 .SH ½ñ¼°
48 .B #include <errno.h>
49 .\".sp
50 .\".BI "extern int " errno ;
51 .\"O .SH DESCRIPTION
52 .SH ÀâÌÀ
53 .\"O The
54 .\"O .I <errno.h>
55 .\"O header file defines the integer variable
56 .\"O .IR errno ,
57 .\"O which is set by system calls and some library functions in the event
58 .\"O of an error to indicate what went wrong.
59 .\"O Its value is significant only when the return value of
60 .\"O the call indicated an error
61 .\"O (i.e., \-1 from most system calls;
62 .\"O \-1 or NULL from most library functions);
63 .\"O a function that succeeds
64 .\"O .I is
65 .\"O allowed to change
66 .\"O .IR errno .
67 ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë
68 .I <errno.h>
69 ¤ÇÀ°¿ô·¿¤ÎÊÑ¿ô
70 .I errno
71 ¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢
72 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¤¤¤¯¤Ä¤«¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë
73 ¤³¤ÎÊÑ¿ô¤Ë¤½¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
74 ¤³¤ÎÃͤϸƤӽФ·¤ÎÊÖ¤êÃͤ¬¥¨¥é¡¼ (¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï
75 \-1 ¤Ç¡¢¤Û¤È¤ó¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤Ï \-1 ¤« NULL) ¤ò¼¨¤·¤¿¤È¤­¤Ë
76 ¤Î¤ß°ÕÌ£¤ò»ý¤Ä¤¬¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤â
77 .I errno
78 ¤òÊѹ¹¤¹¤ë¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£
79
80 .\"O Valid error numbers are all nonzero; \fIerrno\fP is never set to zero
81 .\"O by any system call or library function.
82 Í­¸ú¤Ê¥¨¥é¡¼ÈÖ¹æ¤Ï¤¤¤º¤ì¤â 0 °Ê³°¤ÎÃͤò»ý¤Ä¡£
83 ¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤â¥é¥¤¥Ö¥é¥ê´Ø¿ô¤â
84 \fIerrno\fP ¤ò 0 ¤ËÀßÄꤹ¤ë¤³¤È¤Ï¤Ê¤¤¡£
85
86 .\"O For some system calls and library functions (e.g.,
87 .\"O .BR getpriority (2)),
88 .\"O \-1 is a valid return on success.
89 .\"O In such cases, a successful return can be distinguished from an error
90 .\"O return by setting
91 .\"O .I errno
92 .\"O to zero before the call, and then,
93 .\"O if the call returns a status that indicates that an error
94 .\"O may have occurred, checking to see if
95 .\"O .I errno
96 .\"O has a nonzero value.
97 ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô (Î㤨¤Ð
98 .BR getpriority (2))
99 ¤Ç¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤ÎÍ­¸ú¤ÊÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£
100 ¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢À®¸ù¤Ê¤Î¤«¥¨¥é¡¼¤Ê¤Î¤«¤ò¶èÊ̤¹¤ë¤¿¤á¤Ë¤Ï¡¢
101 ¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë
102 .I errno
103 ¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤±¤Ð¤è¤¤¡£¸Æ¤Ó½Ð¤·¤ÎÊÖ¤êÃͤ¬¥¨¥é¡¼È¯À¸¤Î²ÄǽÀ­¤ò
104 ¼¨¤¹¤â¤Î¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
105 .I errno
106 ¤¬ 0 °Ê³°¤ÎÃͤ«¤ò¸«¤Æ³Îǧ¤¹¤ì¤Ð¤è¤¤¡£
107
108 .\"O \fIerrno\fP is defined by the ISO C standard to be a modifiable lvalue
109 .\"O of type \fIint\fP, and must not be explicitly declared; \fIerrno\fP
110 .\"O may be a macro.
111 .\"O \fIerrno\fP is thread-local; setting it in one thread
112 .\"O does not affect its value in any other thread.
113 \fIerrno\fP ¤Ï¡¢ISO C standard ¤Ç \fIint\fP ·¿¤ÎÊѹ¹²Äǽ¤Êº¸ÊÕÃÍ
114 ¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ÌÀ¼¨Åª¤ËÀë¸À¤ò¹Ô¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤;
115 \fIerrno\fP ¤Ï¥Þ¥¯¥í¤Î¾ì¹ç¤â¤¢¤ê¤¨¤ë¡£
116 \fIerrno\fP ¤Ï¥¹¥ì¥Ã¥ÉËè¤ËÃͤò»ý¤Ä¡£
117 ¤Ä¤Þ¤ê¤¢¤ë¥¹¥ì¥Ã¥É¤Ç \fIerrno\fP ¤¬ÀßÄꤵ¤ì¤Æ¤â¡¢
118 ¾¤Î¥¹¥ì¥Ã¥É¤Î \fIerrno\fP ¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£
119
120 .\"O All the error names specified by POSIX.1
121 .\"O must have distinct values, with the exception of
122 .\"O .B EAGAIN
123 .\"O and
124 .\"O .BR EWOULDBLOCK ,
125 .\"O which may be the same.
126 POSIX.1 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¨¥é¡¼Ì¾¤Ë¤Ï¡¢
127 ¤½¤ì¤¾¤ì°Û¤Ê¤ëÃͤ¬Âбþ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
128 ⤷¡¢
129 .B EAGAIN
130 ¤È
131 .B EWOULDBLOCK
132 ¤ÏÎã³°¤Ç¡¢¤³¤ì¤é¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤â¤è¤¤¡£
133
134 .\" The following is now
135 .\"O .\" POSIX.1 (2001 edition) lists the following symbolic error names.  Of
136 .\"O .\" these, \fBEDOM\fP and \fBERANGE\fP are in the ISO C standard.  ISO C
137 .\"O .\" Amendment 1 defines the additional error number \fBEILSEQ\fP for
138 .\"O .\" coding errors in multibyte or wide characters.
139 .\" POSIX.1 (2001 Ç¯ÈÇ) ¤Ç¤Î¥¨¥é¡¼Ì¾¥·¥ó¥Ü¥ë¤Î¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹¡£
140 .\" ¤³¤ì¤é¤Î¤¦¤Á¡¢ \fBEDOM\fP ¤È \fBERANGE\fP ¤Ï ISO C standard ¤Ë¤¢¤ë¡£
141 .\" ¤µ¤é¤Ë¡¢ISO C Amendment 1 ¤Ç¤Ï¡¢¥¨¥é¡¼ÈÖ¹æ \fBEILSEQ\fP ¤¬
142 .\" ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ä¥ï¥¤¥Éʸ»ú¤Ç¤ÎÉä¹æ²½¥¨¥é¡¼¤òɽ¤¹¤¿¤á¤Ë
143 .\" ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
144 .\"
145 .\"O Below is a list of the symbolic error names that are defined on Linux.
146 .\"O Some of these are marked
147 .\"O .IR POSIX.1 ,
148 .\"O indicating that the name is defined by POSIX.1-2001, or
149 .\"O .IR C99 ,
150 .\"O indicating that the name is defined by C99.
151 .TP 16
152 .B E2BIG
153 .\"O Argument list too long (POSIX.1)
154 °ú¤­¿ô¥ê¥¹¥È¤¬Ä¹²á¤®¤ë (POSIX.1)
155 .TP
156 .B EACCES
157 .\"O Permission denied (POSIX.1)
158 µö²Ä¤¬¤Ê¤¤ (POSIX.1)
159 .TP
160 .B EADDRINUSE
161 .\"O Address already in use (POSIX.1)
162 ¥¢¥É¥ì¥¹¤¬¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë (POSIX.1)
163 .TP
164 .B EADDRNOTAVAIL
165 .\"O Address not available (POSIX.1)
166 ¥¢¥É¥ì¥¹¤¬»ÈÍѤǤ­¤Ê¤¤ (POSIX.1)
167 .\"O .\" EADV is only an error on HURD(?)
168 .\" EADV ¤Ï HURD ¤Ë¤ª¤¤¤Æ¤À¤±¤Î¥¨¥é¡¼(?)
169 .TP
170 .B EAFNOSUPPORT
171 .\"O Address family not supported (POSIX.1)
172 ¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1)
173 .TP
174 .B EAGAIN
175 .\"O Resource temporarily unavailable (may be the same value as
176 .\"O .BR EWOULDBLOCK )
177 .\"O (POSIX.1)
178 ¥ê¥½¡¼¥¹¤¬°ì»þŪ¤ËÍøÍÑÉÔ²Ä
179 .RB ( EWOULDBLOCK
180 ¤ÈƱ¤¸ÃͤǤâ¤è¤¤) (POSIX.1)
181 .TP
182 .B EALREADY
183 .\"O Connection already in progress (POSIX.1)
184 Àܳ¤¬´û¤Ë½èÍýÃæ¤Ç¤¢¤ë (POSIX.1)
185 .TP
186 .B EBADE
187 .\"O Invalid exchange
188 ÉÔÀµ¤Ê¤ä¤ê¼è¤ê (exchange) ¤Ç¤¢¤ë
189 .TP
190 .B EBADF
191 .\"O Bad file descriptor (POSIX.1)
192 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1)
193 .TP
194 .B EBADFD
195 .\"O File descriptor in bad state
196 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ê¾õÂ֤Ǥ¢¤ë
197 .TP
198 .B EBADMSG
199 .\"O Bad message (POSIX.1)
200 ¥á¥Ã¥»¡¼¥¸¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1)
201 .TP
202 .B EBADR
203 .\"O Invalid request descriptor
204 ÉÔÀµ¤Ê¥ê¥¯¥¨¥¹¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿
205 .TP
206 .B EBADRQC
207 .\"O Invalid request code
208 ÉÔÀµ¤Ê¥ê¥¯¥¨¥¹¥È¥³¡¼¥É
209 .TP
210 .B EBADSLT
211 .\"O Invalid slot
212 ÉÔÀµ¤Ê¥¹¥í¥Ã¥È
213 .\" EBFONT is defined but appears not to be used by kernel or glibc.
214 .TP
215 .B EBUSY
216 .\"O Device or resource busy (POSIX.1)
217 ¥ê¥½¡¼¥¹¤¬»ÈÍÑÃæ¤Ç¤¢¤ë (POSIX.1)
218 .TP
219 .B ECANCELED
220 .\"O Operation canceled (POSIX.1)
221 Áàºî¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿ (POSIX.1)
222 .TP
223 .B ECHILD
224 .\"O No child processes (POSIX.1)
225 »Ò¥×¥í¥»¥¹¤¬Ìµ¤¤ (POSIX.1)
226 .TP
227 .B ECHRNG
228 .\"O Channel number out of range
229 ¥Á¥ã¥ó¥Í¥ëÈֹ椬Èϰϳ°¤Ç¤¢¤ë
230 .TP
231 .B ECOMM
232 .\"O Communication error on send
233 Á÷¿®»þ¤ËÄÌ¿®¥¨¥é¡¼¤¬È¯À¸¤·¤¿
234 .TP
235 .B ECONNABORTED
236 .\"O Connection aborted (POSIX.1)
237 Àܳ¤¬Ãæ»ß¤µ¤ì¤¿ (POSIX.1)
238 .TP
239 .B ECONNREFUSED
240 .\"O Connection refused (POSIX.1)
241 Àܳ¤¬µñÈݤµ¤ì¤¿ (POSIX.1)
242 .TP
243 .B ECONNRESET
244 .\"O Connection reset (POSIX.1)
245 Àܳ¤¬¥ê¥»¥Ã¥È¤µ¤ì¤¿ (POSIX.1)
246 .TP
247 .B EDEADLK
248 .\"O Resource deadlock avoided (POSIX.1)
249 ¥ê¥½¡¼¥¹¤Î¥Ç¥Ã¥É¥í¥Ã¥¯¤ò²óÈò¤·¤¿ (POSIX.1)
250 .TP
251 .B EDEADLOCK
252 .\"O Synonym for
253 .\"O .B EDEADLK
254 .B EDEADLK
255 ¤ÎƱµÁ¸ì
256 .TP
257 .B EDESTADDRREQ
258 .\"O Destination address required (POSIX.1)
259 °¸À襢¥É¥ì¥¹¤¬É¬ÍפǤ¢¤ë (POSIX.1)
260 .TP
261 .B EDOM
262 .\"O Mathematics argument out of domain of function (POSIX.1, C99)
263 ¿ô³Ø´Ø¿ô¤Ç°ú¤­¿ô¤¬Îΰ賰¤Ç¤¢¤ë (out of domain)
264 .\" EDOTDOT is defined but appears to be unused
265 .TP
266 .B EDQUOT
267 .\" POSIX just says "Reserved"
268 .\"O Disk quota exceeded (POSIX.1)
269 ¥Ç¥£¥¹¥¯¡¦¥¯¥©¡¼¥¿ (quota) ¤òĶ²á¤·¤¿ (POSIX.1)
270 .TP
271 .B EEXIST
272 .\"O File exists (POSIX.1)
273 ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë (POSIX.1)
274 .TP
275 .B EFAULT
276 .\"O Bad address (POSIX.1)
277 ¥¢¥É¥ì¥¹¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1)
278 .TP
279 .B EFBIG
280 .\"O File too large (POSIX.1)
281 ¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤ë (POSIX.1)
282 .TP
283 .B EHOSTDOWN
284 .\"O Host is down
285 ¥Û¥¹¥È¤¬¥À¥¦¥ó¤·¤Æ¤¤¤ë
286 .TP
287 .B EHOSTUNREACH
288 .\"O Host is unreachable (POSIX.1)
289 ¥Û¥¹¥È¤ËÅþãÉÔǽ¤Ç¤¢¤ë (POSIX.1)
290 .TP
291 .B EIDRM
292 .\"O Identifier removed (POSIX.1)
293 ¼±Ê̻Ҥ¬ºï½ü¤µ¤ì¤¿ (POSIX.1)
294 .TP
295 .B EILSEQ
296 .\"O Illegal byte sequence (POSIX.1, C99)
297 ÉÔÀµ¤Ê¥Ð¥¤¥ÈÎó (POSIX.1, C99)
298 .TP
299 .B EINPROGRESS
300 .\"O Operation in progress (POSIX.1)
301 Áàºî¤¬¼Â¹ÔÃæ¤Ç¤¢¤ë (POSIX.1)
302 .TP
303 .B EINTR
304 .\"O Interrupted function call (POSIX.1); see
305 .\"O .BR signal (7).
306 ´Ø¿ô¸Æ¤Ó½Ð¤·¤¬³ä¤ê¹þ¤Þ¤ì¤¿ (POSIX.1);
307 .BR signal (7)
308 »²¾È¡£
309 .TP
310 .B EINVAL
311 .\"O Invalid argument (POSIX.1)
312 °ú¿ô¤¬Ìµ¸ú¤Ç¤¢¤ë (POSIX.1)
313 .TP
314 .B EIO
315 .\"O Input/output error (POSIX.1)
316 Æþ½ÐÎÏ¥¨¥é¡¼ (POSIX.1)
317 .TP
318 .B EISCONN
319 .\"O Socket is connected (POSIX.1)
320 ¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë (POSIX.1)
321 .TP
322 .B EISDIR
323 .\"O Is a directory (POSIX.1)
324 ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë (POSIX.1)
325 .TP
326 .B EISNAM
327 .\"O Is a named type file
328 ̾Á°ÉÕ¤­¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë
329 .TP
330 .B EKEYEXPIRED
331 .\"O Key has expired
332 ¸°¤¬´ü¸ÂÀÚ¤ì¤È¤Ê¤Ã¤¿
333 .TP
334 .B EKEYREJECTED
335 .\"O Key was rejected by service
336 ¸°¤¬¥µ¡¼¥Ð¤Ë¤è¤êµñÈݤµ¤ì¤¿
337 .TP
338 .B EKEYREVOKED
339 .\"O Key has been revoked
340 ¸°¤¬Ìµ¸ú¤È¤Ê¤Ã¤¿
341 .TP
342 .B EL2HLT
343 .\"O Level 2 halted
344 Ää»ß (¥ì¥Ù¥ë 2)
345 .TP
346 .B EL2NSYNC
347 .\"O Level 2 not synchronized
348 Ʊ´ü¤Ç¤­¤Æ¤¤¤Ê¤¤ (¥ì¥Ù¥ë 2)
349 .TP
350 .B EL3HLT
351 .\"O Level 3 halted
352 Ää»ß (¥ì¥Ù¥ë 3)
353 .TP
354 .B EL3RST
355 .\"O Level 3 halted
356 ¥ê¥»¥Ã¥È (¥ì¥Ù¥ë 3)
357 .TP
358 .B ELIBACC
359 .\"O Cannot access a needed shared library
360 ɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿
361 .TP
362 .B ELIBBAD
363 .\"O Accessing a corrupted shared library
364 ²õ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿
365 .TP
366 .B ELIBMAX
367 .\"O Attempting to link in too many shared libraries
368 ¥ê¥ó¥¯¤·¤è¤¦¤È¤·¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¿²á¤®¤ë
369 .TP
370 .B ELIBSCN
371 .\"O lib section in a.out corrupted
372 a.out ¤Î¥é¥¤¥Ö¥é¥ê¥»¥¯¥·¥ç¥ó¤¬²õ¤ì¤Æ¤¤¤ë (corrupted)
373 .TP
374 .B ELIBEXEC
375 .\"O Cannot exec a shared library directly
376 ¶¦Í­¥é¥¤¥Ö¥é¥ê¤òľÀܼ¹ԤǤ­¤Ê¤«¤Ã¤¿
377 .TP
378 .B ELOOP
379 .\"O Too many levels of symbolic links (POSIX.1)
380 ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î²ó¿ô¤¬Â¿²á¤®¤ë (POSIX.1)
381 .\" ELNRNG is defined but appears to be unused
382 .TP
383 .B EMEDIUMTYPE
384 .\"O Wrong medium type
385 ´Ö°ã¤Ã¤¿¥á¥Ç¥£¥¢¼ïÊ̤Ǥ¢¤ë
386 .TP
387 .B EMFILE
388 .\"O Too many open files (POSIX.1)
389 ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë (POSIX.1)
390 .TP
391 .B EMLINK
392 .\"O Too many links (POSIX.1)
393 ¥ê¥ó¥¯¤¬Â¿²á¤®¤ë (POSIX.1)
394 .TP
395 .B EMSGSIZE
396 .\"O Message too long (POSIX.1)
397 ¥á¥Ã¥»¡¼¥¸¤¬Ä¹²á¤®¤ë (POSIX.1)
398 .TP
399 .B EMULTIHOP
400 .\" POSIX says "Reserved"
401 .\"O Multihop attempted (POSIX.1)
402 ¥Þ¥ë¥Á¥Û¥Ã¥× (multihop) ¤ò»î¤ß¤¿ (POSIX.1)
403 .TP
404 .B ENAMETOOLONG
405 .\"O Filename too long (POSIX.1)
406 ¥Õ¥¡¥¤¥ë̾¤¬Ä¹²á¤®¤ë (POSIX.1)
407 .\" ENAVAIL is defined, but appears not to be used
408 .TP
409 .B ENETDOWN
410 .\"O Network is down (POSIX.1)
411 ¥Í¥Ã¥È¥ï¡¼¥¯¤¬ÉÔÄ̤Ǥ¢¤ë (POSIX.1)
412 .TP
413 .B ENETRESET
414 .\"O Connection aborted by network (POSIX.1)
415 Àܳ¤¬¥Í¥Ã¥È¥ï¡¼¥¯Â¦¤«¤éÃæ»ß¤µ¤ì¤¿ (POSIX.1)
416 .TP
417 .B ENETUNREACH
418 .\"O Network unreachable (POSIX.1)
419 ¥Í¥Ã¥È¥ï¡¼¥¯¤¬ÅþãÉÔǽ¤Ç¤¢¤ë (POSIX.1)
420 .TP
421 .B ENFILE
422 .\"O Too many open files in system (POSIX.1)
423 ¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë (POSIX.1)
424 .\" ENOANO is defined but appears to be unused.
425 .TP
426 .B ENOBUFS
427 .\"O No buffer space available (POSIX.1 (XSI STREAMS option))
428 »ÈÍѲÄǽ¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤ (POSIX.1 (XSI STREAMS option))
429 .\" ENOCSI is defined but appears to be unused.
430 .TP
431 .B ENODATA
432 .\"O No message is available on the STREAM head read queue (POSIX.1)
433 ¥¹¥È¥ê¡¼¥à¤ÎÆɤ߽Ф·¥­¥å¡¼¤ÎÀèƬ¤ËÆɤ߽Ф·²Äǽ¤Ê¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤
434 (POSIX.1)
435 .TP
436 .B ENODEV
437 .\"O No such device (POSIX.1)
438 ¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤Ï̵¤¤ (POSIX.1)
439 .TP
440 .B ENOENT
441 .\"O No such file or directory (POSIX.1)
442 ¤½¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Ï̵¤¤ (POSIX.1)
443 .TP
444 .B ENOEXEC
445 .\"O Exec format error (POSIX.1)
446 ¼Â¹Ô¥Õ¥¡¥¤¥ë·Á¼°¤Î¥¨¥é¡¼ (POSIX.1)
447 .TP
448 .B ENOKEY
449 .\"O Required key not available
450 Í׵ᤵ¤ì¤¿¸°¤¬ÍøÍѤǤ­¤Ê¤¤
451 .TP
452 .B ENOLCK
453 .\"O No locks available (POSIX.1)
454 ÍøÍѤǤ­¤ë¥í¥Ã¥¯¤¬Ìµ¤¤ (POSIX.1)
455 .TP
456 .B ENOLINK
457 .\" POSIX says "Reserved"
458 .\"O Link has been severed (POSIX.1)
459 ¥ê¥ó¥¯¤¬ÀÚ¤ì¤Æ¤¤¤ë (POSIX.1)
460 .TP
461 .B ENOMEDIUM
462 .\"O No medium found
463 ¥á¥Ç¥£¥¢¤¬¸«¤Ä¤«¤é¤Ê¤¤
464 .TP
465 .B ENOMEM
466 .\"O Not enough space (POSIX.1)
467 ½½Ê¬¤Ê¶õ¤­¥á¥â¥êÎΰ褬̵¤¤ (POSIX.1)
468 .TP
469 .B ENOMSG
470 .\"O No message of the desired type (POSIX.1)
471 Í׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤ (POSIX.1)
472 .TP
473 .B ENONET
474 .\"O Machine is not on the network
475 ¥Þ¥·¥ó¤¬¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë¤Ê¤¤
476 .TP
477 .B ENOPKG
478 .\"O Package not installed
479 ¥Ñ¥Ã¥±¡¼¥¸¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤
480 .TP
481 .B ENOPROTOOPT
482 .\"O Protocol not available (POSIX.1)
483 »ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬ÍøÍѤǤ­¤Ê¤¤ (POSIX.1)
484 .TP
485 .B ENOSPC
486 .\"O No space left on device (POSIX.1)
487 ¥Ç¥Ð¥¤¥¹¤Ë¶õ¤­Îΰ褬̵¤¤ (POSIX.1)
488 .TP
489 .B ENOSR
490 .\"O No STREAM resources (POSIX.1 (XSI STREAMS option))
491 »ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¡¦¥ê¥½¡¼¥¹¤¬Â¸ºß¤·¤Ê¤¤ (POSIX.1 (XSI STREAMS option))
492 .TP
493 .B ENOSTR
494 .\"O Not a STREAM (POSIX.1 (XSI STREAMS option))
495 ¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¤ (POSIX.1 (XSI STREAMS option))
496 .TP
497 .B ENOSYS
498 .\"O Function not implemented (POSIX.1)
499 ´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1)
500 .TP
501 .B ENOTBLK
502 .\"O Block device required
503 ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפǤ¢¤ë
504 .TP
505 .B ENOTCONN
506 .\"O The socket is not connected (POSIX.1)
507 ¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1)
508 .TP
509 .B ENOTDIR
510 .\"O Not a directory (POSIX.1)
511 ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤ (POSIX.1)
512 .TP
513 .B ENOTEMPTY
514 .\"O Directory not empty (POSIX.1)
515 ¥Ç¥£¥ì¥¯¥È¥ê¤¬¶õ¤Ç¤Ï¤Ê¤¤ (POSIX.1)
516 .\" ENOTNAM is defined but appears to be unused.
517 .TP
518 .B ENOTSOCK
519 .\"O Not a socket (POSIX.1)
520 ¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¤ (POSIX.1)
521 .TP
522 .B ENOTSUP
523 .\"O Operation not supported (POSIX.1)
524 Áàºî¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1)
525 .TP
526 .B ENOTTY
527 .\"O Inappropriate I/O control operation (POSIX.1)
528 I/O À©¸æÁàºî¤¬Å¬ÀڤǤʤ¤ (POSIX.1)
529 .TP
530 .B ENOTUNIQ
531 .\"O Name not unique on network
532 ̾Á°¤¬¥Í¥Ã¥È¥ï¡¼¥¯¤Ç°ì°Õ¤Ç¤Ï¤Ê¤¤
533 .TP
534 .B ENXIO
535 .\"O No such device or address (POSIX.1)
536 ¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤ä¥¢¥É¥ì¥¹¤Ï¤Ê¤¤ (POSIX.1)
537 .TP
538 .B EOPNOTSUPP
539 .\"O Operation not supported on socket (POSIX.1)
540 ¥½¥±¥Ã¥È¤Ç¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤Áàºî¤Ç¤¢¤ë (POSIX.1)
541 .sp
542 .\"O .RB ( ENOTSUP
543 .\"O and
544 .\"O .B EOPNOTSUPP
545 .\"O have the same value on Linux, but
546 .\"O according to POSIX.1 these error values should be distinct.)
547 (Linux ¤Ç¤Ï
548 .B ENOTSUP
549 ¤È
550 .B EOPNOTSUPP
551 ¤ÏƱ¤¸Ãͤò»ý¤Ä¤¬¡¢
552 POSIX.1 ¤Ë½¾¤¨¤Ðξ¼Ô¤Î¥¨¥é¡¼Ãͤ϶èÊ̤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£)
553 .TP
554 .B EOVERFLOW
555 .\"O Value too large to be stored in data type (POSIX.1)
556 »ØÄꤵ¤ì¤¿¥Ç¡¼¥¿·¿¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÃͤ¬Â礭²á¤®¤ë (POSIX.1)
557 .TP
558 .B EPERM
559 .\"O Operation not permitted (POSIX.1)
560 Áàºî¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1)
561 .TP
562 .B EPFNOSUPPORT
563 .\"O Protocol family not supported
564 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼¤Ç¤¢¤ë
565 .TP
566 .B EPIPE
567 .\"O Broken pipe (POSIX.1)
568 ¥Ñ¥¤¥×¤¬²õ¤ì¤Æ¤¤¤ë (POSIX.1)
569 .TP
570 .B EPROTO
571 .\"O Protocol error (POSIX.1)
572 ¥×¥í¥È¥³¥ë¡¦¥¨¥é¡¼ (POSIX.1)
573 .TP
574 .B EPROTONOSUPPORT
575 .\"O Protocol not supported (POSIX.1)
576 ¥×¥í¥È¥³¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1)
577 .TP
578 .B EPROTOTYPE
579 .\"O Protocol wrong type for socket (POSIX.1)
580 ¥½¥±¥Ã¥È¤Ë»ØÄê¤Ç¤­¤Ê¤¤¥×¥í¥È¥³¥ë¡¦¥¿¥¤¥×¤Ç¤¢¤ë (POSIX.1)
581 .TP
582 .B ERANGE
583 .\"O Result too large (POSIX.1, C99)
584 ·ë²Ì¤¬Â礭²á¤®¤ë (POSIX.1, C99)
585 .TP
586 .B EREMCHG
587 .\"O Remote address changed
588 ¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤¬ÊѤï¤Ã¤¿
589 .TP
590 .B EREMOTE
591 .\"O Object is remote
592 ¥ª¥Ö¥¸¥§¥¯¥È¤¬¥ê¥â¡¼¥È¤Ë¤¢¤ë
593 .TP
594 .B EREMOTEIO
595 .\"O Remote I/O error
596 ¥ê¥â¡¼¥È I/O ¥¨¥é¡¼
597 .TP
598 .B ERESTART
599 .\"O Interrupted system call should be restarted
600 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ìºÆ¥¹¥¿¡¼¥È¤¬É¬ÍפǤ¢¤ë
601 .TP
602 .B EROFS
603 .\"O Read-only file system (POSIX.1)
604 Æɤ߽Ф·ÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë (POSIX.1)
605 .TP
606 .B ESHUTDOWN
607 .\"O Cannot send after transport endpoint shutdown
608 ÄÌ¿®Áê¼ê¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ÆÁ÷¿®¤Ç¤­¤Ê¤¤
609 .TP
610 .B ESPIPE
611 .\"O Invalid seek (POSIX.1)
612 ̵¸ú¤Ê¥·¡¼¥¯ (POSIX.1)
613 .TP
614 .B ESOCKTNOSUPPORT
615 .\"O Socket type not supported
616 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¼ïÊ̤Ǥ¢¤ë
617 .TP
618 .B ESRCH
619 .\"O No such process (POSIX.1)
620 ¤½¤Î¤è¤¦¤Ê¥×¥í¥»¥¹¤Ï̵¤¤ (POSIX.1)
621 .\" ESRMNT is defined but appears not to be used
622 .TP
623 .B ESTALE
624 .\"O Stale file handle (POSIX.1)
625 ¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤¬¸Å¤¤¾õÂ֤ˤʤäƤ¤¤ë (POSIX.1)
626 .sp
627 .\"O This error can occur for NFS and for other file systems
628 NFS ¤ä¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Çµ¯¤³¤ê¤¦¤ë¡£
629 .TP
630 .B ESTRPIPE
631 .\"O Streams pipe error
632 ¥¹¥È¥ê¡¼¥à¡¦¥Ñ¥¤¥×¡¦¥¨¥é¡¼
633 .TP
634 .B ETIME
635 .\"O Timer expired
636 .\"O (POSIX.1 (XSI STREAMS option))
637 »þ´Ö¤¬·Ð²á¤·¤¿
638 (POSIX.1 (XSI STREAMS option))
639 .sp
640 .\"O (POSIX.1 says "STREAM
641 .\"O .BR ioctl (2)
642 .\"O timeout")
643 (POSIX.1 ¤Ç¤Ï "STREAM
644 .BR ioctl (2)
645 timeout" ¤È½ñ¤«¤ì¤Æ¤¤¤ë)
646 .TP
647 .B ETIMEDOUT
648 .\"O Connection timed out (POSIX.1)
649 Áàºî¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿ (POSIX.1)
650 .\" ETOOMANYREFS is defined, but appears not to be used.
651 .TP
652 .B ETXTBSY
653 .\"O Text file busy (POSIX.1)
654 ¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤¬»ÈÍÑÃæ¤Ç¤¢¤ë (POSIX.1)
655 .TP
656 .B EUCLEAN
657 .\"Omotoki: °ÕÌ£¤¬Ê¬¤«¤é¤Ê¤¤¤Î¤Ç¡¢¤½¤Î¤Þ¤Þ¸¶Ê¸¤ò»Ä¤·¤Æ¤¢¤ë¡£
658 .\"O Structure needs cleaning
659 Structure needs cleaning
660 .TP
661 .B EUNATCH
662 .\"O Protocol driver not attached
663 ¥×¥í¥È¥³¥ë¤Î¥É¥é¥¤¥Ð¤¬ÉÕÍ¿ (attach) ¤µ¤ì¤Æ¤¤¤Ê¤¤
664 .TP
665 .B EUSERS
666 .\"O Too many users
667 ¥æ¡¼¥¶¿ô¤¬Â¿²á¤®¤ë
668 .TP
669 .B EWOULDBLOCK
670 .\"O Operation would block (may be same value as
671 .\"O .BR EAGAIN )
672 .\"O (POSIX.1)
673 Áàºî¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¸«¹þ¤ß¤Ç¤¢¤ë
674 .RB ( EAGAIN
675 ¤ÈƱ¤¸ÃͤǤâ¤è¤¤) (POSIX.1)
676 .TP
677 .B EXDEV
678 .\"O Improper link (POSIX.1)
679 ÉÔŬÀڤʥê¥ó¥¯ (POSIX.1)
680 .TP
681 .B EXFULL
682 .\"O Exchange full
683 ÊÑ´¹¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¢¤ë
684 .\"O .SH NOTES
685 .SH Ãí°Õ
686 .\"O A common mistake is to do
687 °Ê²¼¤Ï¤è¤¯¤ä¤ë´Ö°ã¤¤¤Ç¤¢¤ë¡£
688 .in +4n
689 .nf
690
691 if (somecall() == \-1) {
692     printf("somecall() failed\en");
693     if (errno == ...) { ... }
694 }
695
696 .fi
697 .in
698 .\"O where
699 .\"O .I errno
700 .\"O no longer needs to have the value it had upon return from
701 .\"O .IR somecall ()
702 .\"O (i.e., it may have been changed by the
703 .\"O .BR printf (3)).
704 ¤³¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¢»²¾È¤·¤Æ¤¤¤ë»þÅÀ¤Ç¤Ï
705 .I errno
706 ¤Ï¤â¤Ï¤ä
707 .IR somecall ()
708 ¤«¤éÊÖ¤µ¤ì¤¿ÃͤòÊÝ»ý¤·¤Æ¤¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤
709 .RB ( printf (3)
710 ¤Ë¤è¤êÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£
711 .\"O If the value of
712 .\"O .I errno
713 .\"O should be preserved across a library call, it must be saved:
714 ¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¤Þ¤¿¤¤¤Ç
715 .I errno
716 ¤ÎÃͤòÊݸ¤·¤¿¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ËÊݸ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤:
717 .in +4n
718 .nf
719
720 if (somecall() == \-1) {
721     int errsv = errno;
722     printf("somecall() failed\en");
723     if (errsv == ...) { ... }
724 }
725 .fi
726 .in
727 .PP
728 .\"O It was common in traditional C to declare
729 .\"O .I errno
730 .\"O manually
731 .\"O (i.e.,
732 .\"O .IR "extern int errno" )
733 .\"O instead of including
734 .\"O .IR <errno.h> .
735 .\"O .BR "Do not do this" .
736 .\"O It will not work with modern versions of the C library.
737 .\"O However, on (very) old UNIX systems, there may be no
738 .\"O .I <errno.h>
739 .\"O and the declaration is needed.
740 ÀΤΠC ¤Ç¤Ï¡¢
741 .I <errno.h>
742 ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯
743 .I errno
744 ¤ò¼êÆ°¤Ç
745 .RI ( "extern int errno"
746 ¤Î¤è¤¦¤Ë) ÄêµÁ¤¹¤ë¤Î¤¬°ìÈÌŪ¤Ç¤¢¤Ã¤¿¡£
747 .BR "¤³¤Î¤è¤¦¤Ê¤³¤È¤Ï¤·¤Ê¤¤¤³¤È" "¡£"
748 ¤³¤¦¤¹¤ë¤È¡¢ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î C ¥é¥¤¥Ö¥é¥ê¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤À¤í¤¦¡£
749 ¤·¤«¤·¡¢(Èó¾ï¤Ë) ¸Å¤¤ UNIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
750 .I <errno.h>
751 ¤¬¤Ê¤¯¡¢Àë¸À¤¬É¬Íפʤ³¤È¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
752 .\"O .SH "SEE ALSO"
753 .BR err (3),
754 .BR error (3),
755 .BR perror (3),
756 .BR strerror (3)