I am writing a kernel module that polls TCP sockets for their queue sizes. I pass the socket file descriptor number to the module through procfs and then use sockfd_lookup
to find the socket structure (struct socket
) from that.
I am using lsof
to obtain the socket fds but it seems that sockfd_lookup
is always unable to find the appropriate socket. Is there something I am missing concerning the mapping from the output of lsof
to the socket file descriptor numbers?