Getting Socket statistics

Is there any way to get the file descriptor statistics of a socket file descriptor? I know that the fstat, stat system calls are for this purpose, but I want to know it there any way to get socket connection statistics for a file descriptor(like socket flags, connection type etc).

Does /proc hold this information?

Please help...

/proc/net/sockstat holds some info like :

, there is a handy perl module for that as well. HTH.

Thanks a lot for the update.

Does AIX hold this information?

No, I don't think so, I just checked AIX 5.3, but I can't find such file there.