linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Campbell <jon@nerdgrounds.com>
To: ratheesh k <ratheesh.ksz@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: open sockets from task_struct
Date: Sun, 18 Apr 2010 00:30:20 -0700	[thread overview]
Message-ID: <4BCAB50C.9030704@nerdgrounds.com> (raw)
In-Reply-To: <x2hcfeab66d1004180006ob6ebdba5r489f58f4edafc1a@mail.gmail.com>

(reposted because I remember kernel.org mentioning that HTML email is 
verboten or something like that---Sorry!)

I know that on the user-space side any open handles can be seen in the 
/proc/<pid>/fd directory (<pid> is whatever process you're interested in).
Assuming you're talking about reading this from kernel space, I'd look 
at what the procfs filesystem is doing and learn from that.
Sockets and block/char devices are listed like any other file, the list 
is based on file handles.

> I have task_struct structure , how to find all the opened files ? how
> to find opened sockets ?
>
> Thanks,
> Ratheesh
> --
> 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/
>
>
>    


  reply	other threads:[~2010-04-18  7:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-18  7:06 open sockets from task_struct ratheesh k
2010-04-18  7:30 ` Jonathan Campbell [this message]
     [not found] ` <4BCAB35A.6070806@nerdgrounds.com>
     [not found]   ` <s2jcfeab66d1004180056m927c83f6l5642dcf56ad05a5e@mail.gmail.com>
2010-04-18  8:12     ` Jonathan Campbell

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=4BCAB50C.9030704@nerdgrounds.com \
    --to=jon@nerdgrounds.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ratheesh.ksz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).