tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Obtaining list of created sockets



On 2014-06-30 08:52, Johnny Billquist wrote:
On 2014-06-30 08:29, Will Dignazio wrote:
Hi,

I've dug through the so* code, and haven't found any table or list
dedicated to created sockets. The exception only seems to be fsocreate,
which attaches a file descriptor that could be used to find the assigned
socket.

I'm working on a module where I would like to expose the list of created
sockets as a series of directories containing file descriptors that let
you access the properties of the sockets. This of course requires that
the module be aware of all the created sockets in the system. So,
without modifying the current socket creation process, is there a way to
obtain a list or table of created (not necessarily bound/open/listening)
sockets?

Why not just check how netstat does it?

Or lsof, if you want find potential open file descriptors before they have even been bound...

        Johnny



Home | Main Index | Thread Index | Old Index