}
这里同时,注册了一个数据就绪时的叫醒函数
[cpp]
int default_wake_function(wait_queue_t *curr, unsigned mode, int sync,
void *key)
{
return try_to_wake_up(curr->private, mode, sync);
}
调用poll函数。
进入sys_poll等系列内核调用。
准备数据:,注册__pollwait(这是通过初始化poll_wqueues来完成的),复制数据至内核,重新组织成struct poll_list等等。
对所有的struct pollfd循环,以调用do_pollfd函数。
do_pollfd调用file->f_op->poll函数。
然后调用__pollwait创建一个struct poll_table_entry,并将其与当前进程绑定。
将当前进程挂在socket的等待队列上。
有数据就绪时唤醒进程。