PostgreSQL解読室:
ExceptionalCondition()/postgresql-8.1.4
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
このページを編集する際は、[[編集に関する方針]]に従ってく...
*概要 [#rb30092c]
-対象:8.1.4
-言語:C
-[[postgresql-8.1.4/src/include/postgres.h]]にて定義
-同じヘッダーファイルを持つ別々のCファイルに、同じ関数名...
**baclend/port/ipc_test.c 内のコード [#p49bb238]
-エラー情報を標準エラー出力に出力した後、プログラムを停止...
-エラー情報には、引数で指定された、次の情報が含まれる。
--conditionName(エラー状態)
--errorType(エラー値)
--fileName(ファイル名)
--lineNumber(行番号)
**backend/util/error/assert.c 内のコード [#m0b8c84e]
+エラー情報のうち*conditionName、*errorType、*fileNameの...
++どれかが無効であれば、「bad arguments」というメッセージ...
++すべて有効であれば、エラー情報を標準エラー出力に出力す...
+++conditionName(エラー状態)
+++errorType(エラー値)
+++fileName(ファイル名)
+++lineNumber(行番号)
+SLEEP_ON_ASSERTオプションをつけてコンパイルしていた場合...
+プログラムを停止する。
*引数 [#pad3c3ac]
+conditionName : エラー状態
+errorType : エラー値
+fileName : ファイル名
+lineNumber : 行番号
*実装 [#ra626fd9]
**baclend/port/ipc_test.c 内のコード [#p49bb238]
int
ExceptionalCondition(char *conditionName,
char *errorType,
char *fileName,
int lineNumber)
{
fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d...
errorType, conditionName,
fileName, lineNumber);
abort();
return 0;
}
**backend/util/error/assert.c 内のコード [#m0b8c84e]
int
ExceptionalCondition(char *conditionName,
char *errorType,
char *fileName,
int lineNumber)
{
if (!PointerIsValid(conditionName)
|| !PointerIsValid(fileName)
|| !PointerIsValid(errorType))
write_stderr("TRAP: ExceptionalCondition: bad arguments...
-[[PointerIsValid()/postgresql-8.1.4]]
-[[write_stderr()/postgresql-8.1.4]]
else
{
write_stderr("TRAP: %s(\"%s\", File: \"%s\", Line: %d)\...
errorType, conditionName,
fileName, lineNumber);
-[[write_stderr()/postgresql-8.1.4]]
}
#ifdef SLEEP_ON_ASSERT
/*
* It would be nice to use pg_usleep() here, but only do...
* minutes, which seems too short.
*/
sleep(1000000);
#endif
abort();
return 0;
}
*呼出元 [#uc62c0c9]
-[[TrapMacro()/postgresql-8.1.4]]
*備考 [#b85718ee]
-[[assert()>一般用語]]で評価式が偽になったときのエラーハ...
* ExceptionalCondition - Handles the failure of an Asser...
*履歴 [#h6d0daa1]
-作者:[[testnoda/ページ作者]]
-日付:2006/8/9
|更新日|更新者|更新内容|
||||
*コメント [#ve0d4b36]
#comment
終了行:
このページを編集する際は、[[編集に関する方針]]に従ってく...
*概要 [#rb30092c]
-対象:8.1.4
-言語:C
-[[postgresql-8.1.4/src/include/postgres.h]]にて定義
-同じヘッダーファイルを持つ別々のCファイルに、同じ関数名...
**baclend/port/ipc_test.c 内のコード [#p49bb238]
-エラー情報を標準エラー出力に出力した後、プログラムを停止...
-エラー情報には、引数で指定された、次の情報が含まれる。
--conditionName(エラー状態)
--errorType(エラー値)
--fileName(ファイル名)
--lineNumber(行番号)
**backend/util/error/assert.c 内のコード [#m0b8c84e]
+エラー情報のうち*conditionName、*errorType、*fileNameの...
++どれかが無効であれば、「bad arguments」というメッセージ...
++すべて有効であれば、エラー情報を標準エラー出力に出力す...
+++conditionName(エラー状態)
+++errorType(エラー値)
+++fileName(ファイル名)
+++lineNumber(行番号)
+SLEEP_ON_ASSERTオプションをつけてコンパイルしていた場合...
+プログラムを停止する。
*引数 [#pad3c3ac]
+conditionName : エラー状態
+errorType : エラー値
+fileName : ファイル名
+lineNumber : 行番号
*実装 [#ra626fd9]
**baclend/port/ipc_test.c 内のコード [#p49bb238]
int
ExceptionalCondition(char *conditionName,
char *errorType,
char *fileName,
int lineNumber)
{
fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d...
errorType, conditionName,
fileName, lineNumber);
abort();
return 0;
}
**backend/util/error/assert.c 内のコード [#m0b8c84e]
int
ExceptionalCondition(char *conditionName,
char *errorType,
char *fileName,
int lineNumber)
{
if (!PointerIsValid(conditionName)
|| !PointerIsValid(fileName)
|| !PointerIsValid(errorType))
write_stderr("TRAP: ExceptionalCondition: bad arguments...
-[[PointerIsValid()/postgresql-8.1.4]]
-[[write_stderr()/postgresql-8.1.4]]
else
{
write_stderr("TRAP: %s(\"%s\", File: \"%s\", Line: %d)\...
errorType, conditionName,
fileName, lineNumber);
-[[write_stderr()/postgresql-8.1.4]]
}
#ifdef SLEEP_ON_ASSERT
/*
* It would be nice to use pg_usleep() here, but only do...
* minutes, which seems too short.
*/
sleep(1000000);
#endif
abort();
return 0;
}
*呼出元 [#uc62c0c9]
-[[TrapMacro()/postgresql-8.1.4]]
*備考 [#b85718ee]
-[[assert()>一般用語]]で評価式が偽になったときのエラーハ...
* ExceptionalCondition - Handles the failure of an Asser...
*履歴 [#h6d0daa1]
-作者:[[testnoda/ページ作者]]
-日付:2006/8/9
|更新日|更新者|更新内容|
||||
*コメント [#ve0d4b36]
#comment
ページ名: