问题描述
我有一个驱动程序,可以处理多个TCP连接.
I have a driver, which handles several TCP connections.
有没有一种方法可以在给定struct sock
列表的情况下在内核中执行类似于用户空间应用程序api的select/poll()/epoll()?
Is there a way to perform something similar to user space application api's select/poll()/epoll() in kernel given a list of struct sock
's?
谢谢
推荐答案
您可能想编写自己的自定义sk_buff
处理程序,该处理程序调用试图锁定信号量的kernel_select()
并在套接字时进行阻塞等待是打开的.
You may want to write your own custom sk_buff
handler, which calls the kernel_select()
that tries to lock the semaphore and does a blocking wait when the socket is open.
不确定您是否已经通过此链接模拟select()
和poll()
在内核套接字编程中的作用
Not sure if you have already gone through this link Simulate effect of select()
and poll()
in kernel socket programming
这篇关于在设备驱动程序中使用select()/poll()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!