OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / release / man3 / assert_perror.3
1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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 .\" %%%LICENSE_END
24 .\"
25 .\" This replaces an earlier man page written by Walter Harms
26 .\" <walter.harms@informatik.uni-oldenburg.de>.
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .\"
34 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
35 .\"         all rights reserved.
36 .\" Translated Tue Jul  8 05:09:37 JST 2003
37 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\"
39 .TH ASSERT_PERROR 3 2013\-09\-26 GNU "Linux Programmer's Manual"
40 .SH 名前
41 assert_perror \- test errnum and abort
42 .SH 書式
43 .nf
44 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
45 \fB#include <assert.h>\fP
46 .sp
47 \fBvoid assert_perror(int \fP\fIerrnum\fP\fB);\fP
48 .fi
49 .SH 説明
50 最後に \fI<assert.h>\fP がインクルードされた時にマクロ \fBNDEBUG\fP が定義されていた場合、マクロ
51 \fBassert_perror\fP()  は何のコードも生成せず、したがって全く何もしない。 そうでない場合、マクロ \fBassert_perror\fP()
52 は標準エラーにエラーメッセージを表示し、 \fIerrnum\fP が 0 でない場合には \fBabort\fP(3)  を呼び出してプログラムを終了させる。
53 メッセージには、ファイル名、マクロ呼び出しがあった関数名と行番号、 \fIstrerror(errnum)\fP の出力が含まれる。
54 .SH 返り値
55 値は返されない。
56 .SH 準拠
57 これは GNU による拡張である。
58 .SH バグ
59 assert マクロの目的は、プログラマがプログラム中のバグを探す手助けをすることであり、コーディング間違いがない場合には何が起こることはありえない。
60 しかしながら、システムコールやライブラリコールの場合、状況がかなり違っていて、
61 エラーが返されることがありえるし、実際あるだろう。そしてそのような状況でも テストされるべきである。この場合には、 \fBNDEBUG\fP
62 を定義することで無効にできる assert ではなく、適切なエラー処理コードで対処すべきである。 このマクロは決して使わないこと。
63 .SH 関連項目
64 \fBabort\fP(3), \fBassert\fP(3), \fBexit\fP(3), \fBstrerror\fP(3)
65 .SH この文書について
66 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
67 である。プロジェクトの説明とバグ報告に関する情報は
68 http://www.kernel.org/doc/man\-pages/ に書かれている。