* Confused about create_proc_entry
@ 2008-06-07 18:28 RuoMu Hu
[not found] ` <85e5430e0806081002v48cb6625j1877f47c8b98a44e@mail.gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: RuoMu Hu @ 2008-06-07 18:28 UTC (permalink / raw)
To: linux-fsdevel
Hi!
I'm writing a kernel module to add a file under /proc/sys/kernel, but
alway fail to create_proc_entry "sys/kernel/test".
I found that in proc_create() in fs/proc/generic.c (2.6.25.4):
/* At this point there must not be any '/' characters beyond *fn */
if (strchr(fn, '/'))
goto out;
So you cannot create_proc_entry with a name containing "/", but
acturally create_proc_entry with "sysvipc/test" succeeds, and there are
much other codes in the kernel that do this, e.g.:
fs/nfsd/nfsctl.c: entry = create_proc_entry("fs/nfs/exports", 0,
NULL);
fs/proc/proc_tty.c: create_proc_read_entry("tty/ldiscs", 0, NULL,
tty_ldiscs_read_proc, NULL);
I got pretty confused. Any idea? and is it possible to create a file
in /proc/sys/kernel ? How?
Thanks!
Romu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Confused about create_proc_entry
[not found] ` <85e5430e0806081002v48cb6625j1877f47c8b98a44e@mail.gmail.com>
@ 2008-06-08 17:41 ` RuoMu Hu
0 siblings, 0 replies; 2+ messages in thread
From: RuoMu Hu @ 2008-06-08 17:41 UTC (permalink / raw)
To: Narendra Prasad Madanapalli; +Cc: linux-fsdevel
Narendra Prasad Madanapalli wrote:
> Hi Romu,
>
> I have done small research on the same problem and the details are as
> follows:
> 1. Before registering a file into /proc/sys/ you want to add the file
> entry details in <linux-kernel-ver>/kernel/sysctl_check.c
What do you mean by "registering a file"? By create_proc_entry() or
register_sysctl_table()?
Another question: Is it possible to add an entry in /proc/sys/kernel by
register_sysctl_table() without adding an entry to the kern_table[]
array in kernel/sysctl.c?
Your research really helped. Thanks.
Best regards,
Romu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-08 17:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-07 18:28 Confused about create_proc_entry RuoMu Hu
[not found] ` <85e5430e0806081002v48cb6625j1877f47c8b98a44e@mail.gmail.com>
2008-06-08 17:41 ` RuoMu Hu
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).