.\" Copyright (c) 2007 Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2007-06-02, Akihiro MOTOKI .\" .TH BSD_SIGNAL 3 2019\-03\-06 "" "Linux Programmer's Manual" .SH 名前 bsd_signal \- BSD 方式のシグナル処理 .SH 書式 \fB#include \fP .PP \fBtypedef void (*sighandler_t)(int);\fP .PP \fBsighandler_t bsd_signal(int \fP\fIsignum\fP\fB, sighandler_t \fP\fIhandler\fP\fB);\fP .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP .ad l \fBbsd_signal\fP(): .RS 4 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED glibc 2.26 以降: _XOPEN_SOURCE >= 500 && ! (_POSIX_C_SOURCE\ >=\ 200809L) .br Glibc 2.25 and earlier: _XOPEN_SOURCE .RE .ad b .SH 説明 \fBbsd_signal\fP() 関数は \fBsignal\fP(2) と同じ引数をとり、同じ処理を実行する。 .PP 両者の違いは、 \fBbsd_signal\fP() では信頼性のあるシグナル処理方式の提供が保証されていることである。 信頼性のあるシグナル処理方式は以下の特徴を持つ。 a) ハンドラーが起動された場合に、シグナルの処理方法 (disposition) が デフォルトにリセットされない、 b) シグナルハンドラーの実行中は、それ以降に発生した同じシグナルの配送が ブロックされない、 c) ハンドラーが停止中の (blocking している) システムコールを 中断した場合、そのシステムコールが自動的に再開される。 移植性が必要なアプリケーションでは、 \fBsignal\fP(2) でこれらが保証されることを前提にすべきではない。 .SH 返り値 \fBbsd_signal\fP() 関数はシグナルハンドラーの直前の値を返す。 エラーの場合、 \fBSIG_ERR\fP を返す。 .SH エラー \fBsignal\fP(2) と同じ。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBbsd_signal\fP() T} Thread safety MT\-Safe .TE .SH 準拠 4.2BSD, POSIX.1\-2001. POSIX.1\-2008 では \fBbsd_signal\fP() の仕様が削除されている。 代わりに、 \fBsigaction\fP(2) の使用が推奨されている。 .SH 注意 \fBbsd_signal\fP() の使用は避けるべきである。代わりに \fBsigaction\fP(2) を使うこと。 .PP 最近の Linux システムでは、 \fBbsd_signal\fP() と \fBsignal\fP(2) は等価である。しかし、以前のシステムでは、 \fBsignal\fP(2) は信頼性に欠けるシグナル処理方式を提供していた。 詳細は \fBsignal\fP(2) を参照。 .PP \fIsighandler_t\fP を使っているのは GNU による拡張である。 この型は機能検査マクロ \fB_GNU_SOURCE\fP を定義した場合にのみ定義される。 .SH 関連項目 \fBsigaction\fP(2), \fBsignal\fP(2), \fBsysv_signal\fP(3), \fBsignal\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。