proc entry path name
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
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 5 lines · Amol Lad
I'm doing
create_proc_entryreturn 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
[email protected]
https://lists.osdl.org/mailman/listinfo/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
Quoted 17 lines · Alexey Dobriyan
Quoted 5 lines · Amol Lad
I'm doing
create_proc_entryreturn 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
Quoted 7 lines
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Hi,
Quoted 9 lines · walter harms
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 }
Quoted 5 lines
KERN_ERR"foo:create_proc_entry>/proc/maintainers/janitor/alexeyin 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
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 4 lines
Also, isn't it true, if it is not called this way, (ie: if it is called as -
create_proc_entry("foobar", 0644, parent)) thenparent->nameis 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 */
}Quoted 9 lines
Regards
Steve
Quoted 6 lines
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors