Why do we need to call poll_wait in poll?

前端 未结 3 606
野趣味
野趣味 2021-01-11 15:05

In LDD3, i saw such codes

static unsigned int scull_p_poll(struct file *filp, poll_table *wait)
{
    struct scull_pipe *dev = filp->private_data;
    uns         


        
3条回答
  •  余生分开走
    2021-01-11 15:55

    poll_wait triggers when there is an expected event occurred on any of the fd's it is waiting on OR it hits timeout.

    Check the mask to know which event triggered poll_wait. If you don't want poll_wait to trigger on such event, you can configure it while registering file descriptor to poll fd.

提交回复
热议问题