Linux API to determine sockets owned by a process

后端 未结 7 1833
梦毁少年i
梦毁少年i 2020-12-23 02:01

Is there a Linux library that will enable me to tell what IP sockets are owned by what processes? I guess I\'m looking for the programmatic equivalent of lsof -i

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 02:31

    You could try running lsof with strace and see just which files in /proc it gets data from.

提交回复
热议问题