{"id":3931,"date":"2022-12-20T17:28:26","date_gmt":"2022-12-20T20:28:26","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/sigevent-man7\/"},"modified":"2022-12-20T17:28:26","modified_gmt":"2022-12-20T20:28:26","slug":"sigevent-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/sigevent-man7\/","title":{"rendered":"SIGEVENT (man7)"},"content":{"rendered":"<h1 align=\"center\">SIGEVENT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">sigevent \u2212 structure for notification from asynchronous routines<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">#include <signal.h><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">union sigval { \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Data passed with notification bodies\/ usr\/ <br \/> int sival_int; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Integer value bodies\/ usr\/ <br \/> void *sival_ptr; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Pointer value bodies\/ usr\/ <br \/> };<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">struct sigevent { <br \/> int sigev_notify; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Notification method bodies\/ usr\/ <br \/> int sigev_signo; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Notification signal bodies\/ usr\/ <br \/> union sigval sigev_value; <br \/> \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Data passed with notification bodies\/ usr\/ <br \/> void (*sigev_notify_function) (union sigval); <br \/> \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Function used for thread <br \/> notification (SIGEV_THREAD) bodies\/ usr\/ <br \/> void *sigev_notify_attributes; <br \/> \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Attributes for notification thread <br \/> (SIGEV_THREAD) bodies\/ usr\/ <br \/> pid_t sigev_notify_thread_id; <br \/> \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var ID of thread to signal <br \/> (SIGEV_THREAD_ID); Linux-specific bodies\/ usr\/ <br \/> };<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigevent<\/i> structure is used by various APIs to describe the way a process is to be notified about an event (e.g., completion of an asynchronous request, expiration of a timer, or the arrival of a message).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The definition shown in the SYNOPSIS is approximate: some of the fields in the <i>sigevent<\/i> structure may be defined as part of a union. Programs should employ only those fields relevant to the value specified in <i>sigev_notify<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigev_notify<\/i> field specifies how notification is to be performed. This field can have one of the following values: <b><br \/> SIGEV_NONE<\/b><\/p>\n<p style=\"margin-left:22%;\">A &#8220;null&#8221; notification: don\u2019t do anything when the event occurs.<\/p>\n<p style=\"margin-left:11%;\"><b>SIGEV_SIGNAL<\/b><\/p>\n<p style=\"margin-left:22%;\">Notify the process by sending the signal specified in <i>sigev_signo<\/i>.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If the signal is caught with a signal handler that was registered using the <b>sigaction<\/b>(2) <b>SA_SIGINFO<\/b> flag, then the following fields are set in the <i>siginfo_t<\/i> structure that is passed as the second argument of the handler:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"12%\">\n<p><i>si_code<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"63%\">\n<p>This field is set to a value that depends on the API delivering the notification.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"12%\">\n<p><i>si_signo<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"63%\">\n<p>This field is set to the signal number (i.e., the same value as in <i>sigev_signo<\/i>).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"12%\">\n<p><i>si_value<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"63%\">\n<p>This field is set to the value specified in <i>sigev_value<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">Depending on the API, other fields may also be set in the <i>siginfo_t<\/i> structure.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The same information is also available if the signal is accepted using <b>sigwaitinfo<\/b>(2).<\/p>\n<p style=\"margin-left:11%;\"><b>SIGEV_THREAD<\/b><\/p>\n<p style=\"margin-left:22%;\">Notify the process by invoking <i>sigev_notify_function<\/i> &#8220;as if&#8221; it were the start function of a new thread. (Among the implementation possibilities here are that each timer notification could result in the creation of a new thread, or that a single thread is created to receive all notifications.) The function is invoked with <i>sigev_value<\/i> as its sole argument. If <i>sigev_notify_attributes<\/i> is not NULL, it should point to a <i>pthread_attr_t<\/i> structure that defines attributes for the new thread (see <b>pthread_attr_init<\/b>(3)).<\/p>\n<p style=\"margin-left:11%;\"><b>SIGEV_THREAD_ID<\/b> (Linux-specific)<\/p>\n<p style=\"margin-left:22%;\">Currently used only by POSIX timers; see <b>timer_create<\/b>(2).<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>timer_create<\/b>(2), <b>aio_fsync<\/b>(3), <b>aio_read<\/b>(3), <b>aio_write<\/b>(3), <b>getaddrinfo_a<\/b>(3), <b>lio_listio<\/b>(3), <b>mq_notify<\/b>(3), <b>aio<\/b>(7), <b>pthreads<\/b>(7)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  sigevent \u2212 structure for notification from asynchronous routines <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,972,1024],"class_list":["post-3931","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-sigevent"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3931"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3931\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}