OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man7 / sigevent.7
1 .\" Copyright (C) 2006, 2010 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" Copyright (C) 2009 Petr Baudis <pasky@suse.cz>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH SIGEVENT 7 2011\-09\-09 GNU "Linux Programmer's Manual"
32 .SH 名前
33 sigevent \- 非同期ルーチンからの通知用の構造体
34 .SH 書式
35 .nf
36
37 union sigval {          /* Data passed with notification */
38     int     sival_int;         /* Integer value */
39     void   *sival_ptr;         /* Pointer value */
40 };
41
42 struct sigevent {
43     int          sigev_notify; /* Notification method */
44     int          sigev_signo;  /* Notification signal */
45     union sigval sigev_value;  /* Data passed with
46                                   notification */
47     void       (*sigev_notify_function) (union sigval);
48                      /* Function used for thread
49                         notification (SIGEV_THREAD) */
50     void        *sigev_notify_attributes;
51                      /* Attributes for notification thread
52                         (SIGEV_THREAD) */
53     pid_t        sigev_notify_thread_id;
54                      /* ID of thread to signal (SIGEV_THREAD_ID) */
55 };
56 .fi
57 .SH 説明
58 .PP
59 \fIsigevent\fP 構造体は、イベントに関する情報をプロセスに通知するために様々な API で使用される (イベントの例としては、
60 非同期処理要求の完了、 タイマーの満了、 メッセージの到着など)。
61 .PP
62 「書式」に記載されている定義はおおよそのものである。 \fIsigevent\fP 構造体のいくつかのフィールドは、
63 共用体の一部として定義されているものもある。 プログラムは、 \fIsigev_notify\fP で指定された値に応じたフィールドだけを利用すべきである。
64 .PP
65 \fIsigev_notify\fP フィールドは、通知をどのように処理すべきかを指定する。 このフィールドは、以下のいずれかの値である。
66 .TP  8
67 \fBSIGEV_NONE\fP
68 「空 (null)」の通知。 イベントが発生時には何もしないこと。
69 .TP 
70 \fBSIGEV_SIGNAL\fP
71 \fIsigev_signo\fP で指定されたシグナルを送信することで、プロセスへの通知を行う。
72 .IP
73 \fBsigaction\fP(2) の \fBSA_SIGINFO\fP フラグを使った登録されたシグナルハンドラによりシグナルが捕捉されると、
74 シグナルハンドラの 2 番目の引き数として渡された \fIsiginfo_t\fP 構造体の以下のフィールドが設定される。
75 .RS 8
76 .TP  10
77 \fIsi_code\fP
78 このフィールドには通知を配送した API に応じた決まる値が設定される。
79 .TP 
80 \fIsi_signo\fP
81 このフィールドにはシグナル番号 (すなわち \fIsigev_signo\fP と同じ値) が設定される。
82 .TP 
83 \fIsi_value\fP
84 このフィールドには \fIsigev_value\fP で指定された値が設定される。
85 .RE
86 .IP
87 API によっては \fIsiginfo_t\fP 構造体の他のフィールドが設定される場合もある。
88 .IP
89 シグナルを受け取ったときには \fBsigwaitinfo\fP(2) でも同じ情報が得られる。
90 .TP 
91 \fBSIGEV_THREAD\fP
92 「あたかも」新しいスレッドセーフの開始関数であるかのように \fIsigev_notify_function\fP を起動することで、 プロセスへの通知を行う
93 (実装の可能性としては、 タイマー通知の度に新しいスレッドセーフが作成される場合も、 一つのスレッドを作成してすべての通知を受信する場合もある)。
94 この関数は \fIsigev_value\fP を唯一の引き数として起動される。 \fIsigev_notify_attributes\fP は、 NULL
95 以外の場合は、 新しいスレッドセーフの属性を定義する \fIpthread_attr_t\fP 構造体を指していなければならない
96 (\fBpthread_attr_init\fP(3) 参照)。
97 .TP 
98 \fBSIGEV_THREAD_ID\fP (Linux 固有)
99 .\" | SIGEV_SIGNAL vs not?
100 現在のところ POSIX でのみ使用されている。 \fBtimer_create\fP(2) 参照。
101 .SH 準拠
102 POSIX.1\-2001.
103 .SH 関連項目
104 \fBtimer_create\fP(2), \fBaio_fsync\fP(3), \fBaio_read\fP(3), \fBaio_write\fP(3),
105 \fBgetaddrinfo_a\fP(3), \fBlio_listio\fP(3), \fBmq_notify\fP(3), \fBaio\fP(7),
106 \fBpthreads\fP(7)
107 .SH この文書について
108 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
109 である。プロジェクトの説明とバグ報告に関する情報は
110 http://www.kernel.org/doc/man\-pages/ に書かれている。