All of lore.kernel.org
 help / color / mirror / Atom feed
From: Buddy Lucas <buddy.lucas@gmail.com>
To: Matthew Hindle <luminary@penguinmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: /proc/[number] special entries
Date: Sun, 10 Oct 2004 17:35:32 +0200	[thread overview]
Message-ID: <5d6b657504101008351100aa53@mail.gmail.com> (raw)
In-Reply-To: <1097386284.7715.3.camel@chiyo.azumanga>

Hi Matt,

On Sun, 10 Oct 2004 15:31:24 +1000, Matthew Hindle
<luminary@penguinmail.com> wrote:
> I was wondering if anybody could help me with a hint or two...
> 
> I'm trying to add a sub-directory to each /proc/[number] directory
> (where [number] is a process id). I think that I need to get a
> proc_dir_entry* so that I can call:
> 
> proc_mkdir("mysubdir", (struct proc_dir_entry *) parent);
> 
> However, I can't work out how to get a reference to the proc_dir_entry*
> I need. I can find the other entries in the proc directory (such as bus,
> cpuinfo. misc, net...) by doing something like this:
> 
> struct proc_dir_entry * dp;
> dp = &proc_root;
> dp = dp->subdir;
> while (dp != NULL) {
>   printk("er... found: %s\n",dp->name);
>   dp = dp->next;
> }
> 
> However, the only entries that don't show up are the [number] entries.
> Assistance please!

The PID entries in /proc are special cases: see proc_root_readdir().
I'm guessing though that you'll want to take a look at the struct
pid_entry stuff in fs/proc/base.c, it's all there.


Cheers,
Buddy

> Please CC: any replies to <luminary@penguinmail.com>.
> 
> Kind regards,
> Matt Hindle.
> 
> -
> 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:[~2004-10-10 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-10  5:31 /proc/[number] special entries Matthew Hindle
2004-10-10 15:35 ` Buddy Lucas [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=5d6b657504101008351100aa53@mail.gmail.com \
    --to=buddy.lucas@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luminary@penguinmail.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.