All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	netdev@oss.sgi.com
Subject: given a struct sock, how to find pid of process that owns it?
Date: Wed, 03 Sep 2003 13:17:25 -0400	[thread overview]
Message-ID: <3F562225.4010609@nortelnetworks.com> (raw)


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	


             reply	other threads:[~2003-09-03 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-03 17:17 Chris Friesen [this message]
2003-09-03 19:00 ` given a struct sock, how to find pid of process that owns it? Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F562225.4010609@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.