.\" Copyright (C) 2006, 2010 Michael Kerrisk .\" Copyright (C) 2009 Petr Baudis .\" .\" %%%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) 2013 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2013-07-31, Akihiro MOTOKI .\" .TH SIGEVENT 7 2011\-09\-09 GNU "Linux Programmer's Manual" .SH 名前 sigevent \- 非同期ルーチンからの通知用の構造体 .SH 書式 .nf union sigval { /* Data passed with notification */ int sival_int; /* Integer value */ void *sival_ptr; /* Pointer value */ }; struct sigevent { int sigev_notify; /* Notification method */ int sigev_signo; /* Notification signal */ union sigval sigev_value; /* Data passed with notification */ void (*sigev_notify_function) (union sigval); /* Function used for thread notification (SIGEV_THREAD) */ void *sigev_notify_attributes; /* Attributes for notification thread (SIGEV_THREAD) */ pid_t sigev_notify_thread_id; /* ID of thread to signal (SIGEV_THREAD_ID) */ }; .fi .SH 説明 .PP \fIsigevent\fP 構造体は、イベントに関する情報をプロセスに通知するために様々な API で使用される (イベントの例としては、 非同期処理要求の完了、 タイマーの満了、 メッセージの到着など)。 .PP 「書式」に記載されている定義はおおよそのものである。 \fIsigevent\fP 構造体のいくつかのフィールドは、 共用体の一部として定義されているものもある。 プログラムは、 \fIsigev_notify\fP で指定された値に応じたフィールドだけを利用すべきである。 .PP \fIsigev_notify\fP フィールドは、通知をどのように処理すべきかを指定する。 このフィールドは、以下のいずれかの値である。 .TP 8 \fBSIGEV_NONE\fP 「空 (null)」の通知。 イベントが発生時には何もしないこと。 .TP \fBSIGEV_SIGNAL\fP \fIsigev_signo\fP で指定されたシグナルを送信することで、プロセスへの通知を行う。 .IP \fBsigaction\fP(2) の \fBSA_SIGINFO\fP フラグを使った登録されたシグナルハンドラーによりシグナルが捕捉されると、 シグナルハンドラーの 2 番目の引き数として渡された \fIsiginfo_t\fP 構造体の以下のフィールドが設定される。 .RS 8 .TP 10 \fIsi_code\fP このフィールドには通知を配送した API に応じた決まる値が設定される。 .TP \fIsi_signo\fP このフィールドにはシグナル番号 (すなわち \fIsigev_signo\fP と同じ値) が設定される。 .TP \fIsi_value\fP このフィールドには \fIsigev_value\fP で指定された値が設定される。 .RE .IP API によっては \fIsiginfo_t\fP 構造体の他のフィールドが設定される場合もある。 .IP シグナルを受け取ったときには \fBsigwaitinfo\fP(2) でも同じ情報が得られる。 .TP \fBSIGEV_THREAD\fP 「あたかも」新しいスレッドセーフの開始関数であるかのように \fIsigev_notify_function\fP を起動することで、 プロセスへの通知を行う (実装の可能性としては、 タイマー通知の度に新しいスレッドセーフが作成される場合も、 一つのスレッドを作成してすべての通知を受信する場合もある)。 この関数は \fIsigev_value\fP を唯一の引き数として起動される。 \fIsigev_notify_attributes\fP は、 NULL 以外の場合は、 新しいスレッドセーフの属性を定義する \fIpthread_attr_t\fP 構造体を指していなければならない (\fBpthread_attr_init\fP(3) 参照)。 .TP \fBSIGEV_THREAD_ID\fP (Linux 固有) .\" | SIGEV_SIGNAL vs not? 現在のところ POSIX でのみ使用されている。 \fBtimer_create\fP(2) 参照。 .SH 準拠 POSIX.1\-2001. .SH 関連項目 \fBtimer_create\fP(2), \fBaio_fsync\fP(3), \fBaio_read\fP(3), \fBaio_write\fP(3), \fBgetaddrinfo_a\fP(3), \fBlio_listio\fP(3), \fBmq_notify\fP(3), \fBaio\fP(7), \fBpthreads\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部である。 プロジェクトの説明とバグ報告に関する情報は \%http://www.kernel.org/doc/man\-pages/ に書かれている。