'\" t .\" Copyright (c) 2005 by Michael Kerrisk .\" .\" 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. .\" .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. .\" Translated 2005-12-04, Akihiro MOTOKI .\" .TH SIGSET 3 2010-09-20 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O sigset, sighold, sigrelse, sigignore \- System V signal API sigset, sighold, sigrelse, sigignore \- System V 版シグナル API .\"O .SH SYNOPSIS .SH 書式 .B #include .sp .B typedef void (*sighandler_t)(int); .sp .BI "sighandler_t sigset(int " sig ", sighandler_t " disp ); .sp .BI "int sighold(int " sig ); .sp .BI "int sigrelse(int " sig ); .sp .BI "int sigignore(int " sig ); .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .BR sigset (), .BR sighold (), .BR sigrelse (), .BR sigignore (): .br .RS 4 _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O These functions are provided in glibc as a compatibility interface .\"O for programs that make use of the historical System V signal API. .\"O This API is obsolete: new applications should use the POSIX signal API .\"O .RB ( sigaction (2), .\"O .BR sigprocmask (2), .\"O etc.) これらの関数は、昔ながらの System V 版シグナル API を使用しているプログラム に対して互換性のあるインタフェースを glibc で提供するものである。 この API は過去のものであり、新しいアプリケーションでは POSIX シグナル API .RB ( sigaction (2), .BR sigprocmask (2) など) を使用すべきである。 .\"O The .\"O .BR sigset () .\"O function modifies the disposition of the signal .\"O .IR sig . .\"O The .\"O .I disp .\"O argument can be the address of a signal handler function, .\"O or one of the following constants: 関数 .BR sigset () はシグナル .I sig のシグナルハンドラの動作を変更する。 .I disp 引き数には、シグナルハンドラ関数のアドレスか、 以下の定数のいずれか一つを指定できる。 .TP .B SIG_DFL .\"O Reset the disposition of .\"O .I sig .\"O to the default. .I sig の動作をデフォルトにリセットする。 .TP .B SIG_IGN .\"O Ignore .\"O .IR sig . .I sig を無視する。 .TP .B SIG_HOLD .\"O Add .\"O .I sig .\"O to the process's signal mask, but leave the disposition of .\"O .I sig .\"O unchanged. そのプロセスのシグナルマスクに .I sig を追加するが、 .I sig の動作は変更しない。 .PP .\"O If .\"O .I disp .\"O specifies the address of a signal handler, then .\"O .I sig .\"O is added to the process's signal mask during execution of the handler. .I disp にシグナルハンドラのアドレスが指定された場合、 シグナルハンドラの実行中は、そのプロセスのシグナルマスクに .I sig が追加される。 .PP .\"O If .\"O .I disp .\"O was specified as a value other than .\"O .BR SIG_HOLD , .\"O then .\"O .I sig .\"O is removed from the process's signal mask. .I disp に .B SIG_HOLD 以外の値が指定された場合、 そのプロセスのシグナルマスクから .I sig が削除される。 .PP .\"O The dispositions for .\"O .B SIGKILL .\"O and .\"O .B SIGSTOP .\"O cannot be changed. シグナル .B SIGKILL と .B SIGSTOP に対する動作は変更できない。 .PP .\"O The .\"O .BR sighold () .\"O function adds .\"O .I sig .\"O to the calling process's signal mask. 関数 .BR sighold () は、呼び出し元プロセスのシグナルマスクに .I sig を追加する。 .\"O The .\"O .BR sigrelse () .\"O function removes .\"O .I sig .\"O from the calling process's signal mask. 関数 .BR sigrelse () は、呼び出し元プロセスのシグナルマスクから .I sig を削除する。 .\"O The .\"O .BR sigignore () .\"O function sets the disposition of .\"O .I sig .\"O to .\"O .BR SIG_IGN . 関数 .BR sigignore () は、 .I sig の動作を .B SIG_IGN に設定する。 .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, .\"O .BR sigset () .\"O returns .\"O .B SIG_HOLD .\"O if .\"O .I sig .\"O was blocked before the call, .\"O or the signal's previous disposition .\"O if it was not blocked before the call. .BR sigset () は成功すると、 呼び出し前に .I sig がブロックされていた場合には .B SIG_HOLD を返し、 ブロックされていなかった場合には 変更前のそのシグナルの動作を返す。 .\"O On error, .\"O .BR sigset () .\"O returns \-1, with .\"O .I errno .\"O set to indicate the error. エラーの場合、 .BR sigset () は \-1 を返し、 .I errno にエラーを示す値をセットする。 .\"O (But see BUGS below.) 但し、以下の「バグ」の節も参照のこと。 .\"O The .\"O .BR sighold (), .\"O .BR sigrelse (), .\"O and .\"O .BR sigignore () .\"O functions return 0 on success; on error, these functions return \-1 and set .\"O .I errno .\"O to indicate the error. 関数 .BR sighold (), .BR sigrelse (), .BR sigignore () は成功すると 0 を返す。エラーの場合、\-1 を返し、 .I errno にエラーを示す値をセットする。 .\"O .SH ERRORS .SH エラー .\"O For .\"O .BR sigset () .\"O see the ERRORS under .\"O .BR sigaction (2) .\"O and .\"O .BR sigprocmask (2). .BR sigset () に関しては、 .BR sigaction (2) と .BR sigprocmask (2) の「エラー」の節を参照。 .\"O For .\"O .BR sighold () .\"O and .\"O .BR sigrelse () .\"O see the ERRORS under .\"O .BR sigprocmask (2). .BR sighold () と .BR sigrelse () に関しては、 .BR sigprocmask (2) の「エラー」の節を参照。 .\"O For .\"O .BR sigignore (), .\"O see the errors under .\"O .BR sigaction (2). .BR sigignore () に関しては、 .BR sigaction (2) の「エラー」の節を参照。 .\"O .SH "CONFORMING TO" .SH 準拠 SVr4, POSIX.1-2001. .\"O These functions are obsolete: do not use them in new programs. これらの関数は廃止予定である。新しいプログラムでは使用しないこと。 .\"O POSIX.1-2008 marks .\"O .BR sighold (), .\"O .BR sigignore (), .\"O .BR sigpause (), .\"O .BR sigrelse (), .\"O and .\"O .BR sigset () .\"O as obsolete, recommending the use of .\"O .BR sigaction (2), .\"O .BR sigprocmask (2), .\"O .BR pthread_sigmask (3), .\"O and .\"O .BR sigsuspend (2) .\"O instead. POSIX.1-2008 は、 .BR sighold (), .BR sigignore (), .BR sigpause (), .BR sigrelse (), .BR sigset () を廃止予定としている。 代わりに、 .BR sigaction (2), .BR sigprocmask (2), .BR pthread_sigmask (3), .BR sigsuspend (2) の使用が推奨されている。 .\"O .SH NOTES .SH 注意 .\"O These functions appeared in glibc version 2.1. これらの関数は glibc 2.1 で登場した。 .\"O The .\"O .I sighandler_t .\"O type is a GNU extension; it is only used on this page to make the .\"O .BR sigset () .\"O prototype more easily readable. .I sighandler_t 型は GNU による拡張であり、この man page で .BR sigset () のプロトタイプをより読みやすくするために使われているだけである。 .\"O The .\"O .BR sigset () .\"O function provides reliable signal handling semantics (as when calling .\"O .BR sigaction (2) .\"O with .\"O .I sa_mask .\"O equal to 0). 関数 .BR sigset () は信頼性のあるシグナル処理機構を提供する .RI ( sa_mask を 0 で .BR sigaction (2) を呼び出したときと同様)。 .\"O On System V, the .\"O .BR signal () .\"O function provides unreliable semantics (as when calling .\"O .BR sigaction (2) .\"O with .\"O .I sa_mask .\"O equal to .\"O .IR "SA_RESETHAND | SA_NODEFER" ). System V では、関数 .BR signal () が提供する処理機構は信頼性のないものである .RI ( sa_mask を .IR "SA_RESETHAND | SA_NODEFER" として .BR sigaction (2) を呼び出したときと同様)。 .\"O On BSD, .\"O .BR signal () .\"O provides reliable semantics. BSD では、 .BR signal () は信頼性のある処理機構を提供する。 .\"O POSIX.1-2001 leaves these aspects of .\"O .BR signal () .\"O unspecified. POSIX.1-2001 では、 .BR signal () のこの点は規定しないままとなっている。 .\"O See .\"O .BR signal (2) .\"O for further details. さらなる詳細については .BR signal (2) を参照。 .\"O In order to wait for a signal, .\"O BSD and System V both provided a function named .\"O .BR sigpause (3), .\"O but this function has a different argument on the two systems. .\"O See .\"O .BR sigpause (3) .\"O for details. BSD と System V のどちらのシステムでも シグナルを待つために、 .BR sigpause (3) という名前の関数が提供されているが、 この関数の引き数は両方のシステムで異なる。 詳細は .BR sigpause (3) を参照。 .\"O .SH BUGS .SH バグ .\"O In versions of glibc before 2.2, .\"O .BR sigset () .\"O did not unblock .\"O .I sig .\"O if .\"O .I disp .\"O was specified as a value other than .\"O .BR SIG_HOLD . 2.2 より前のバージョンの glibc では、 .I disp に .B SIG_HOLD 以外の値が指定された場合、 .I sig のブロック解除を行っていなかった。 .\"O In all versions of glibc up to and including 2.3.5, .\"O .BR sigset () .\"O does not correctly return the previous disposition of the signal .\"O in two cases. 2.3.5 以前の全てのバージョンの glibc では、 .BR sigset () が変更前のシグナルの動作を正しく返さない場合が 2つある。 .\"O First, if .\"O .I disp .\"O is specified as .\"O .BR SIG_HOLD , .\"O then a successful .\"O .BR sigset () .\"O always returns .\"O .BR SIG_HOLD . .\"O Instead, it should return the previous disposition of the signal .\"O (unless the signal was blocked, in which case .\"O .B SIG_HOLD .\"O should be returned). 一つめは、 .I disp に .B SIG_HOLD が指定されると、成功した場合 .BR sigset () は常に .B SIG_HOLD を返すことである。 正しくは、(シグナルがブロックされていなかった場合には) 変更前のシグナルの動作を返すべきである (シグナルがブロックされていた場合には、 .B SIG_HOLD が返される)。 .\"O Second, if the signal is currently blocked, then .\"O the return value of a successful .\"O .BR sigset () .\"O should be .\"O .BR SIG_HOLD . .\"O Instead, the previous disposition of the signal is returned. もう一つは、シグナルが現在ブロックされている場合には、 成功した場合の .BR sigset () の返り値は .B SIG_HOLD になるべきであるが、実際には 変更前のシグナルの動作が返されることである。 .\"O These problems have been fixed since glibc 2.5. これらの問題は glibc 2.5 以降で修正されている。 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951 .\"O .SH "SEE ALSO" .SH 関連項目 .BR kill (2), .BR pause (2), .BR sigaction (2), .BR signal (2), .BR sigprocmask (2), .BR raise (3), .BR sigpause (3), .BR sigvec (3), .BR signal (7)