lkml.org 
[lkml]   [2003]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectgiven a struct sock, how to find pid of process that owns it?

I'm working on a small app similar to netstat that only cares about unix
sockets.

I can easily walk /proc/net/unix, but to find the owner of the socket I
need to scan /proc, which gets expensive.

Accordingly, I'd like to extend /proc/net/unix to also dump out the pid
of the process that owns the socket. The only thing is, I can't seem to
figure out how to find the pid of the socket owner given a pointer to
the socket struct.

Any tips? Is it even there?

Thanks,

Chris


--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.037 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site