1 .\" Copyright (c) 1994 Michael Haardt (michael@moria.de), 1994-06-04
2 .\" Copyright (c) 1995 Michael Haardt
3 .\" (michael@cantor.informatik.rwth-aachen.de), 1995-03-16
4 .\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl), 1996-01-13
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License as
8 .\" published by the Free Software Foundation; either version 2 of
9 .\" the License, or (at your option) any later version.
11 .\" The GNU General Public License's references to "object code"
12 .\" and "executables" are to be interpreted as the output of any
13 .\" document formatting or typesetting system, including
14 .\" intermediate and printed output.
16 .\" This manual is distributed in the hope that it will be useful,
17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 .\" GNU General Public License for more details.
21 .\" You should have received a copy of the GNU General Public
22 .\" License along with this manual; if not, write to the Free
23 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
26 .\" 1996-01-13 aeb: merged in some text contributed by Melvin Smith
27 .\" (msmith@falcon.mercer.peachnet.edu) and various other changes.
28 .\" Modified 1996-05-16 by Martin Schulze (joey@infodrom.north.de)
30 .\" Japanese Version Copyright (c) 1998 TACHIBANA Akira
31 .\" all rights reserved.
32 .\" Translated 1998-05-28, TACHIBANA Akira <tati@tky.3web.ne.jp>
33 .\" Updated 2001-12-21, Kentaro Shirakata <argrath@ub32.org>
34 .\" Updated 2005-03-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .TH PERROR 3 2007-07-26 "" "Linux Programmer's Manual"
39 .\"O perror \- print a system error message
40 perror \- システムエラーメッセージを出力する
45 .BI "void perror(const char *" s );
49 .BI "const char *" sys_errlist [];
56 .\"O Feature Test Macro Requirements for glibc (see
57 .\"O .BR feature_test_macros (7)):
59 .RB ( feature_test_macros (7)
70 .\"O produces a message on the standard error output, describing the last
71 .\"O error encountered during a call to a system or library function.
74 は、システムコールやライブラリ関数の呼び出しにおいて、最後に発生した
75 エラーに関する説明メッセージを生成し、標準エラー出力に出力する。
80 .\"O is not a null byte (\(aq\\0\(aq)) the argument string
82 .\"O is printed, followed by a colon and a blank.
83 .\"O Then the message and a new-line.
87 が NULL バイト (\(aq\\0\(aq) でない場合には) 引き数の文字列
89 がまず出力され、続いてコロン、空白が出力され、
92 .\"O To be of most use, the argument string should include the name
93 .\"O of the function that incurred the error.
94 .\"O The error number is taken from
95 .\"O the external variable
97 .\"O which is set when errors occur but not
98 .\"O cleared when successful calls are made.
99 このメッセージを最大限活用するためには、引き数文字列にエラーが発生した
108 .\"O The global error list
109 .\"O .IR sys_errlist "[]"
112 .\"O can be used to obtain the error message without the newline.
113 .\"O The largest message number provided in the table is
114 .\"O .IR sys_nerr " \-1."
115 .\"O Be careful when directly accessing this list because new error values
116 .\"O may not have been added to
117 .\"O .IR sys_errlist "[]."
122 を添字とする配列で、この配列から改行無しのエラーメッセージが取得される。
126 このテーブルを直接参照する際には注意すること。なぜなら、新しいエラー番号が
130 .\"O When a system call fails, it usually returns \-1 and sets the
133 .\"O to a value describing what went wrong.
134 .\"O (These values can be found in
135 .\"O .IR <errno.h> .)
136 .\"O Many library functions do likewise.
137 システムコールが失敗した場合、通常、返り値として \-1 が返り、
139 にエラーを識別する値が設定される (設定されるエラー番号は
145 .\"O serves to translate this error code into human-readable form.
148 .\"O is undefined after a successful library call:
149 .\"O this call may well change this variable, even though it succeeds,
150 .\"O for example because it internally used some other library function that failed.
153 は、このエラーコードの可読なメッセージへの変換を行う。
155 は、ライブラリ呼び出しが成功した後には未定義であることに注意が必要である:
156 その呼び出し自身は成功したとしても、内部で呼び出した他のライブラリ関数が
157 失敗して、その結果をこの変数に設定することがあるからだ。
158 .\"O Thus, if a failing call is not immediately followed by a call to
162 .\"O should be saved.
169 .\"O .SH "CONFORMING TO"
173 .\"O and the external
177 .\"O conform to C89, C99, 4.3BSD, POSIX.1-2001.
188 参照) は C89, 4.3BSD, POSIX.1-2001 に準拠している。
200 .\"O are defined by glibc, but in
209 .\"O .\" and only when _BSD_SOURCE is defined.
211 .\"O .\" .B _GNU_SOURCE
212 .\"O .\" is defined, the symbols
213 .\"O .\" .I _sys_nerr
215 .\"O .\" .I _sys_errlist
216 .\"O .\" are provided.
218 .\" が定義された場合にのみ、これらの変数は定義される。