From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: given a struct sock, how to find pid of process that owns it?
Date: Wed, 3 Sep 2003 12:00:45 -0700 [thread overview]
Message-ID: <20030903120045.69df335c.shemminger@osdl.org> (raw)
In-Reply-To: <3F562225.4010609@nortelnetworks.com>
On Wed, 03 Sep 2003 13:17:25 -0400
Chris Friesen <cfriesen@nortelnetworks.com> wrote:
>
> 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.
>
There is a N to 1 relationship, you will end up needing the scan.
prev parent reply other threads:[~2003-09-03 19:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-03 17:17 Chris Friesen
2003-09-03 19:00 ` Stephen Hemminger [this message]
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=20030903120045.69df335c.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®