/* * structures and helpers for f_op->poll implementations
*/ typedefvoid (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);
/* * Do not touch the structure directly, use the access function * poll_requested_events() instead.
*/ typedefstruct poll_table_struct {
poll_queue_proc _qproc;
__poll_t _key;
} poll_table;
staticinlinevoid poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{ if (p && p->_qproc) {
p->_qproc(filp, wait_address, p); /* * This memory barrier is paired in the wq_has_sleeper(). * See the comment above prepare_to_wait(), we need to * ensure that subsequent tests in this thread can't be * reordered with __add_wait_queue() in _qproc() paths.
*/
smp_mb();
}
}
/* * Return the set of events that the application wants to poll for. * This is useful for drivers that need to know whether a DMA transfer has * to be started implicitly on poll(). You typically only want to do that * if the application is actually polling for POLLIN and/or POLLOUT.
*/ staticinline __poll_t poll_requested_events(const poll_table *p)
{ return p ? p->_key : ~(__poll_t)0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.