1SIGEVENT(7)                Linux Programmer's Manual               SIGEVENT(7)
2
3
4

NAME

6       sigevent - structure for notification from asynchronous routines
7

SYNOPSIS

9       #include <signal.h>
10
11       union sigval {            /* Data passed with notification */
12           int     sival_int;    /* Integer value */
13           void   *sival_ptr;    /* Pointer value */
14       };
15
16       struct sigevent {
17           int    sigev_notify;  /* Notification method */
18           int    sigev_signo;   /* Notification signal */
19           union sigval sigev_value;
20                                 /* Data passed with notification */
21           void (*sigev_notify_function) (union sigval);
22                                 /* Function used for thread
23                                    notification (SIGEV_THREAD) */
24           void  *sigev_notify_attributes;
25                                 /* Attributes for notification thread
26                                    (SIGEV_THREAD) */
27           pid_t  sigev_notify_thread_id;
28                                 /* ID of thread to signal
29                                    (SIGEV_THREAD_ID); Linux-specific */
30       };
31

DESCRIPTION

33       The  sigevent  structure  is used by various APIs to describe the way a
34       process is to be notified about an event (e.g., completion of an  asyn‐
35       chronous request, expiration of a timer, or the arrival of a message).
36
37       The definition shown in the SYNOPSIS is approximate: some of the fields
38       in the sigevent structure may be defined as part of a union.   Programs
39       should  employ  only  those  fields  relevant to the value specified in
40       sigev_notify.
41
42       The sigev_notify field specifies how notification is to  be  performed.
43       This field can have one of the following values:
44
45       SIGEV_NONE
46              A "null" notification: don't do anything when the event occurs.
47
48       SIGEV_SIGNAL
49              Notify   the   process   by  sending  the  signal  specified  in
50              sigev_signo.
51
52              If the signal is caught with a signal handler  that  was  regis‐
53              tered using the sigaction(2) SA_SIGINFO flag, then the following
54              fields are set in the siginfo_t structure that is passed as  the
55              second argument of the handler:
56
57              si_code   This  field  is set to a value that depends on the API
58                        delivering the notification.
59
60              si_signo  This field is set to the signal number (i.e., the same
61                        value as in sigev_signo).
62
63              si_value  This   field   is   set  to  the  value  specified  in
64                        sigev_value.
65
66              Depending on the API, other fields may also be set in  the  sig‐
67              info_t structure.
68
69              The same information is also available if the signal is accepted
70              using sigwaitinfo(2).
71
72       SIGEV_THREAD
73              Notify the process by invoking sigev_notify_function "as if"  it
74              were the start function of a new thread.  (Among the implementa‐
75              tion possibilities here are that each timer  notification  could
76              result  in the creation of a new thread, or that a single thread
77              is created to receive all notifications.)  The function  is  in‐
78              voked  with  sigev_value  as  its  sole  argument.  If sigev_no‐
79              tify_attributes is not NULL, it should point to a pthread_attr_t
80              structure  that  defines  attributes  for  the  new  thread (see
81              pthread_attr_init(3)).
82
83       SIGEV_THREAD_ID (Linux-specific)
84              Currently used only by POSIX timers; see timer_create(2).
85

SEE ALSO

87       timer_create(2),  aio_fsync(3),   aio_read(3),   aio_write(3),   getad‐
88       drinfo_a(3), lio_listio(3), mq_notify(3), aio(7), pthreads(7)
89

COLOPHON

91       This  page  is  part of release 5.10 of the Linux man-pages project.  A
92       description of the project, information about reporting bugs,  and  the
93       latest     version     of     this    page,    can    be    found    at
94       https://www.kernel.org/doc/man-pages/.
95
96
97
98GNU                               2020-11-01                       SIGEVENT(7)
Impressum