OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / 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 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\"*******************************************************************
25 .\"
26 .\" This file was generated with po4a. Translate the source file.
27 .\"
28 .\"*******************************************************************
29 .TH SIGEVENT 7 2011\-09\-09 GNU "Linux Programmer's Manual"
30 .SH 名前
31 sigevent \- structure for notification from asynchronous routines
32 .SH 書式
33 .nf
34
35 union sigval {          /* Data passed with notification */
36     int     sival_int;         /* Integer value */
37     void   *sival_ptr;         /* Pointer value */
38 };
39
40 struct sigevent {
41     int          sigev_notify; /* Notification method */
42     int          sigev_signo;  /* Notification signal */
43     union sigval sigev_value;  /* Data passed with
44                                   notification */
45     void       (*sigev_notify_function) (union sigval);
46                      /* Function used for thread
47                         notification (SIGEV_THREAD) */
48     void        *sigev_notify_attributes;
49                      /* Attributes for notification thread
50                         (SIGEV_THREAD) */
51     pid_t        sigev_notify_thread_id;
52                      /* ID of thread to signal (SIGEV_THREAD_ID) */
53 };
54 .fi
55 .SH 説明
56 .PP
57 The \fIsigevent\fP structure is used by various APIs to describe the way a
58 process is to be notified about an event (e.g., completion of an
59 asynchronous request, expiration of a timer, or the arrival of a message).
60 .PP
61 The definition shown in the SYNOPSIS is approximate: some of the fields in
62 the \fIsigevent\fP structure may be defined as part of a union.  Programs
63 should only employ those fields relevant to the value specified in
64 \fIsigev_notify\fP.
65 .PP
66 The \fIsigev_notify\fP field specifies how notification is to be performed.
67 This field can have one of the following values:
68 .TP  8
69 \fBSIGEV_NONE\fP
70 A "null" notification: don't do anything when the event occurs.
71 .TP 
72 \fBSIGEV_SIGNAL\fP
73 Notify the process by sending the signal specified in \fIsigev_signo\fP.
74 .IP
75 If the signal is caught with a signal handler that was registered using the
76 \fBsigaction\fP(2)  \fBSA_SIGINFO\fP flag, then the following fields are set in
77 the \fIsiginfo_t\fP structure that is passed as the second argument of the
78 handler:
79 .RS 8
80 .TP  10
81 \fIsi_code\fP
82 This field is set to a value that depends on the API delivering the
83 notification.
84 .TP 
85 \fIsi_signo\fP
86 This field is set to the signal number (i.e., the same value as in
87 \fIsigev_signo\fP).
88 .TP 
89 \fIsi_value\fP
90 This field is set to the value specified in \fIsigev_value\fP.
91 .RE
92 .IP
93 Depending on the API, other fields may also be set in the \fIsiginfo_t\fP
94 structure.
95 .IP
96 The same information is also available if the signal is accepted using
97 \fBsigwaitinfo\fP(2).
98 .TP 
99 \fBSIGEV_THREAD\fP
100 Notify the process by invoking \fIsigev_notify_function\fP "as if" it were the
101 start function of a new thread.  (Among the implementation possibilities
102 here are that each timer notification could result in the creation of a new
103 thread, or that a single thread is created to receive all notifications.)
104 The function is invoked with \fIsigev_value\fP as its sole argument.  If
105 \fIsigev_notify_attributes\fP is not NULL, it should point to a
106 \fIpthread_attr_t\fP structure that defines attributes for the new thread (see
107 \fBpthread_attr_init\fP(3)).
108 .TP 
109 \fBSIGEV_THREAD_ID\fP (Linux\-specific)
110 .\" | SIGEV_SIGNAL vs not?
111 Currently used only by POSIX timers; see \fBtimer_create\fP(2).
112 .SH 準拠
113 POSIX.1\-2001.
114 .SH 関連項目
115 \fBtimer_create\fP(2), \fBaio_fsync\fP(3), \fBaio_read\fP(3), \fBaio_write\fP(3),
116 \fBgetaddrinfo_a\fP(3), \fBlio_listio\fP(3), \fBmq_notify\fP(3), \fBaio\fP(7),
117 \fBpthreads\fP(7)