How to view thread id of a process which has opened a socket connection?

后端 未结 2 1677
野趣味
野趣味 2021-01-17 19:17

I have a process where multiple threads open multiple socket connection. I want to view this information and map what thread has opened which socket port. lsof -i

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-17 19:31

    Unless you strace()'d the process, no.

    Once the file descriptor is open, it "belongs" equally to all the threads in the process (as far as the kernel is concerned), you can't see which thread opened it.

提交回复
热议问题