File: strerror.3

package info (click to toggle)
manpages-ja 0.5.0.0.20080615-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 20,508 kB
  • ctags: 1
  • sloc: sh: 13,690; perl: 157; makefile: 114
file content (194 lines) | stat: -rw-r--r-- 5,645 bytes parent folder | download
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
.\" and Copyright (C) 2005, Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\"     386BSD man pages
.\" Modified Sat Jul 24 18:05:30 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Fri Feb 16 14:25:17 1996 by Andries Brouwer <aeb@cwi.nl>
.\" Modified Sun Jul 21 20:55:44 1996 by Andries Brouwer <aeb@cwi.nl>
.\" Modified Mon Oct 15 21:16:25 2001 by John Levon <moz@compsoc.man.ac.uk>
.\" Modified Tue Oct 16 00:04:43 2001 by Andries Brouwer <aeb@cwi.nl>
.\" Modified Fri Jun 20 03:04:30 2003 by Andries Brouwer <aeb@cwi.nl>
.\" 2005-12-13, mtk, Substantial rewrite of strerror_r() description
.\"         Addition of extra material on portability and standards.
.\"
.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
.\"       all rights reserved.
.\" Translated 1997-01-20, YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
.\" Updated & Modified 2001-11-03, Yuichi SATO <ysato@h4.dion.ne.jp>
.\" Updated 2005-12-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2007-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
.\"
.\"WORD         GNU-specific            GNU ͤ
.\"WORD         XSI-compliant           XSI 
.\"
.TH STRERROR 3  2007-07-26 "" "Linux Programmer's Manual"
.SH ̾
strerror, strerror_r \- 顼ֹʸ֤
.SH 
.nf
.B #include <string.h>
.sp
.BI "char *strerror(int " errnum );
.sp
.BI "char *strerror_r(int " errnum ", char *" buf ", size_t " buflen );
.fi
.sp
.in -4n
glibc εǽޥ׷
.RB ( feature_test_macros (7)
):
.in
.sp
ξˤ
XSI ΥС
.BR strerror_r ()
󶡤:
.br
(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !\ _GNU_SOURCE
.fi
.SH 
.BR strerror ()
ؿϡ \fIerrnum\fP ǰϤ
顼ɤʸ֤
ǽǤʤСŬڤʸ򤹤뤿ˡ
ߤΥ
.B LC_MESSAGES
Ȥ
ʸϡץꥱѹƤϤʤʤ
θ˵
.BR perror (3)

.BR strerror ()
θƤӽФ
ѹƤ⹽ʤ
ʸѹ饤֥ؿϤʤ

.BR strerror_r ()
ؿ
.BR strerror ()
ȻƤ뤬
åɥդǤ롣
δؿˤΥС¸ߤ
POSIX.1-2001 ǵꤵ줿 XSI ΥС
(glibc 2.3.4 ʹߤѲǽ) ȡ
GNU ͤΥС (glibc 2.0 ʹߤѲǽ) Ǥ롣
ֽ񼰡פ˵ܤ줿ǽޥξˤϡ
XSI ΥС󶡤롣
ʳξˤ GNU ͤΥС󶡤롣
ǽޥĤŪʤ硢
(glibc 2.4 ʹߤǤ) ǥեȤ
.B _POSIX_SOURCE
 200112l 졢η
XSI ΥС
.BR strerror_r ()
ǥեȤ󶡤롣

ܿɬפʥץꥱǤϡ
XSI 
.BR strerror_r ()
Ȥ褤
δؿϡ桼󶡤Ĺ
.I buflen
ΥХåե
.I buf
˥顼ʸ֤

GNU ͤ
.BR strerror_r ()
ϡ顼åǼʸؤΥݥ󥿤֤
֤ͤϡδؿ
.I buf
˳ǼʸؤΥݥ󥿤
餫 (Ѥ) ŪʸؤΥݥ󥿡Τ줫Ȥʤ
(Ԥξ
.I buf
ϻѤʤ)
.I buf
ʸ󤬳Ǽϡ

.I buflen
ХȤǼ
.RI ( buflen
᤮Ȥˤʸڤͤ)
ʸˤɬü̥ʸޤޤ롣
.SH ֤
.BR strerror ()

.BR strerror_r ()
ϥ顼Ƥ
ʸ֤顼ֹ椬̤Τξ "Unknown error nnn" Ȥ
å֤

XSI 
.BR strerror_r ()
ؿ 0 ֤
顼ξˤϡ \-1 ֤
.I errno
˥顼Ƥ򼨤ͤ򥻥åȤ롣
.SH 顼
.TP
.B EINVAL
.I errnum
ͤͭʥ顼ֹǤϤʤ
.TP
.B ERANGE
顼ɤʸΤˡʬΰ褬ݤǤʤä
.SH 
.BR strerror ()
 POSIX.1-2001, C89, C99 ǵꤵƤ롣
.BR strerror_r ()
 POSIX.1-2001 ǵꤵƤ롣

GNU ͤ
.BR strerror_r ()
ؿɸγĥǤ롣

POSIX.1-2001 ϡ
.BR strerror ()
.I errno
򥻥åȤ뤳ȤǧƤ뤬顼ȯ˴ؿη̤Ȥ
ɤ֤ͤ٤ꤷƤʤ
륷ƥǤϡ
.\" 㤨 Solaris 8, HP-UX 11
顼ֹ椬̤Τξ硢
.BR strerror ()
 NULL ֤
¾ΥƥǤϡ
.\" 㤨 FreeBSD 5.4, Tru64 5.1B
顼ֹ椬̤Τξ硢
.BR strerror ()
 "Error nnn occurred" Ȥäʸ֤
.I errno

.B EINVAL
򥻥åȤ롣
.SH Ϣ
.BR err (3),
.BR errno (3),
.BR error (3),
.BR perror (3),
.BR strsignal (3)