Parsing /proc/net/tcp
I'm writing a small script to parse /proc/net/tcp. It works properly for most part except for entries with inode values set to 0. My question is, how do you map such inodes to their respective pids?
For example, this gets processed just fine, I take the inode number, search through /proc/pid/fd/* to see which fd is a symlink to 'socket:[inode]' and split that path to return the pid Code:
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode Code:
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode |
Maybe comparing this with the output of lsof -nPi TCP might help.
|
All times are GMT -5. The time now is 12:27 AM. |