How to get a list of open sockets in Linux using C?

前端 未结 4 1618
名媛妹妹
名媛妹妹 2020-12-15 11:39

Is there a way to get a list of all open sockets ( socket address or socket descriptor ) in Linux using C in user-space or kernel?

Thank you

4条回答
  •  再見小時候
    2020-12-15 12:40

    This program may be useful for you and demonstrates how to parse the /net/proc/* files sockstat.c

提交回复
热议问题