// raw sock数据就绪函数
// raw sock在raw_recvmsg中阻塞,在raw_local_deliver通过sock->sk_data_ready通知输入数据就绪
// 步骤:
// 1.过滤感兴趣的事件
// 2.唤醒阻塞进程,并将进程从wq上取下
1.1 static int receiver_wake_function(wait_queue_t *wait, unsigned int mode, int sync,
void *key)
{
unsigned long bits = (unsigned long)key;
//POLLIN输入数据就绪
//POLLER输出数据就绪
if (bits && !(bits & (POLLIN | POLLERR)))
return 0;
//唤醒阻塞进程,并将进程从wq上取下
return autoremove_wake_function(wait, mode, sync, key);
}
// 唤醒阻塞进程,并将进程从wq上取下
1.2 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
{
int ret = default_wake_function(wait, mode, sync, key);
if (ret)
list_del_init(&wait->task_list);
return ret;
}
网络子系统83_inet协议族-SOCK_RAW(四),布布扣,bubuko.com
网络子系统83_inet协议族-SOCK_RAW(四)