How can i match each /proc/net/tcp entry to each opened socket?

血红的双手。 提交于 2019-11-27 13:17:11

Take the inode number (in this case, 507218). Each open file descriptor to that socket (there may be multiple file descriptors for the same socket) will appear as a link of the form:

/proc/<PID>/fd/<N> -> socket[507218]

(where <PID> is the process ID and <N> is the file descriptor).

Depends on the architecture as to how /proc can be formatted, but on Linux:

http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!