{"id":4185,"date":"2022-12-20T17:39:39","date_gmt":"2022-12-20T20:39:39","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/poll_wait-man9\/"},"modified":"2022-12-20T17:39:39","modified_gmt":"2022-12-20T20:39:39","slug":"poll_wait-man9","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/poll_wait-man9\/","title":{"rendered":"poll_wait (man9)"},"content":{"rendered":"<h1 align=\"center\">poll_wait<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#AVAILABILITY\">AVAILABILITY<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">poll_wait \u2212 wait for selectable event to be ready<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <linux\/poll.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>void poll_wait(structwait_queue**<\/b><i>sync<\/i><b>, poll_table*<\/b><i>pt<\/i><b>)<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This function is used in support of the poll device driver entry point. The intent is for a device driver to put <i>sync<\/i> into the poll table immediately entering the device poll routine, then returning a bit mask of events that are currently ready. The kernel looks at the mask of events to see if something it needs is ready, and suspends the process if not.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">static unsigned int xxpoll(struct file*file, poll_table*pt) <br \/> { <br \/> poll_wait(&#038;data_in_sync, pt); <br \/> if (data_in.cnt > 0) return POLLIN | POLLRDNORM; <br \/> else return 0; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This example shows the basic use of <b>poll_wait<\/b>(9) in a device driver poll function.<\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Linux kernel 2.1.34+<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>intro<\/b>(9)<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Stephen Williams <steve@icarus.com><\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">To early to say.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  poll_wait \u2212 wait for selectable event to be ready <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1222],"tags":[1226,1223,1225,1265],"class_list":["post-4185","post","type-post","status-publish","format-standard","hentry","category-9-rutinas-del-nucleo","tag-1226","tag-kernel","tag-man9","tag-poll_wait"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4185","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=4185"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4185\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}