* [KJ] proc entry path name
@ 2006-09-15 11:51 Amol Lad
2006-09-15 23:42 ` Alexey Dobriyan
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Amol Lad @ 2006-09-15 11:51 UTC (permalink / raw)
To: kernel-janitors
Hi,
I'm doing create_proc_entry return code audit. On failure I would like
to print "Unable to create /proc/foo/bar".
Is there a function that takes struct proc_dir_entry * and returns
fullpathname ?
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [KJ] proc entry path name
2006-09-15 11:51 [KJ] proc entry path name Amol Lad
@ 2006-09-15 23:42 ` Alexey Dobriyan
2006-09-16 10:58 ` walter harms
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2006-09-15 23:42 UTC (permalink / raw)
To: kernel-janitors
On Fri, Sep 15, 2006 at 05:09:30PM +0530, Amol Lad wrote:
> I'm doing create_proc_entry return code audit. On failure I would like
> to print "Unable to create /proc/foo/bar".
>
> Is there a function that takes struct proc_dir_entry * and returns
> fullpathname ?
Me not understand why would you want it.
entry = create_proc_entry("alexey", 0644, NULL);
if (!entry) {
printk(KERN_ERR "foo: create_proc_entry alexey failed\n");
...
}
Alexey #define KERN_ERR "" Dobriyan
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [KJ] proc entry path name
2006-09-15 11:51 [KJ] proc entry path name Amol Lad
2006-09-15 23:42 ` Alexey Dobriyan
@ 2006-09-16 10:58 ` walter harms
2006-09-18 13:39 ` steve
2006-09-19 6:18 ` Amol Lad
3 siblings, 0 replies; 5+ messages in thread
From: walter harms @ 2006-09-16 10:58 UTC (permalink / raw)
To: kernel-janitors
hi all,
so far i understand the question was how to:
entry = create_proc_entry("alexey", 0644, NULL);
if (!entry) {
printk(KERN_ERR "foo: create_proc_entry >%s< failed\n",realpath);
}
KERN_ERR "foo: create_proc_entry >/proc/maintainers/janitor/alexey< failed
in very nested configurations (that you should not have) there may be more than
one alexey. and you end up with a knowledge that one of them failed.
something like getcwd() would be helpful.
re,
walter
Alexey Dobriyan wrote:
> On Fri, Sep 15, 2006 at 05:09:30PM +0530, Amol Lad wrote:
>> I'm doing create_proc_entry return code audit. On failure I would like
>> to print "Unable to create /proc/foo/bar".
>>
>> Is there a function that takes struct proc_dir_entry * and returns
>> fullpathname ?
>
> Me not understand why would you want it.
>
> entry = create_proc_entry("alexey", 0644, NULL);
> if (!entry) {
> printk(KERN_ERR "foo: create_proc_entry alexey failed\n");
> ...
> }
>
> Alexey #define KERN_ERR "" Dobriyan
>
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
>
>
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [KJ] proc entry path name
2006-09-15 11:51 [KJ] proc entry path name Amol Lad
2006-09-15 23:42 ` Alexey Dobriyan
2006-09-16 10:58 ` walter harms
@ 2006-09-18 13:39 ` steve
2006-09-19 6:18 ` Amol Lad
3 siblings, 0 replies; 5+ messages in thread
From: steve @ 2006-09-18 13:39 UTC (permalink / raw)
To: kernel-janitors
Hi,
walter harms wrote:
> hi all,
> so far i understand the question was how to:
>
> entry = create_proc_entry("alexey", 0644, NULL);
> if (!entry) {
> printk(KERN_ERR "foo: create_proc_entry >%s
> }
>
>
> KERN_ERR "foo: create_proc_entry >/proc/maintainers/janitor/alexey
>
> in very nested configurations (that you should not have) there may be more than
> one alexey. and you end up with a knowledge that one of them failed.
> something like getcwd() would be helpful.
Correct me if I am wrong but isn't it true that if create_proc_entry() is called
with the 3rd parameter as NULL, it implies that the parent directory is '/proc'
(or technically the symbol - 'proc_root') ?
Also, isn't it true, if it is not called this way, (ie: if it is called as -
create_proc_entry("foobar", 0644, parent)) then parent->name is the full path of
the parent ?
Regards
Steve
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [KJ] proc entry path name
2006-09-15 11:51 [KJ] proc entry path name Amol Lad
` (2 preceding siblings ...)
2006-09-18 13:39 ` steve
@ 2006-09-19 6:18 ` Amol Lad
3 siblings, 0 replies; 5+ messages in thread
From: Amol Lad @ 2006-09-19 6:18 UTC (permalink / raw)
To: kernel-janitors
> Also, isn't it true, if it is not called this way, (ie: if it is called as -
> create_proc_entry("foobar", 0644, parent)) then parent->name is the full path of
> the parent ?
parent->name does not contains the full path of the parent. I think the
only way to generate a full pathname is:
for (ent = leaf; ent != &proc_root; ent = ent->parent) {
/* Extract ent->name and use it in preparing full pathname */
}
>
> Regards
> Steve
>
>
>
>
>
>
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
>
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-19 6:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 11:51 [KJ] proc entry path name Amol Lad
2006-09-15 23:42 ` Alexey Dobriyan
2006-09-16 10:58 ` walter harms
2006-09-18 13:39 ` steve
2006-09-19 6:18 ` Amol Lad
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.