Re: /proc parent &proc_root == NULL?

From: Al Viro
Date: Wed Jan 26 2005 - 22:21:12 EST


On Wed, Jan 26, 2005 at 09:33:48PM -0500, John Richard Moser wrote:
> create_proc_entry("kmsg", S_IRUSR, &proc_root);
>
> So this is asking for proc_root to be filled?
>
> create_proc_entry("kcore", S_IRUSR, NULL);
>
> And this is just saying to shove it in proc's root?

NULL is equivalent to &proc_root in that context; moreover, it's better
style - drivers really shouldn't be refering to what is procfs-private
object.

> I'm trying to locate a specific proc entry, using this lovely piece of
> code I ripped off:

That's not something allowed outside of procfs code - lifetime rules
alone make that a Very Bad Idea(tm). If that's just debugging - OK,
but if your code really uses that stuff, I want details on the intended
use. In that case your design is almost certainly asking for trouble.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/