From: RuoMu Hu <huruomu@gmail.com>
To: linux-fsdevel@vger.kernel.org
Subject: Confused about create_proc_entry
Date: Sun, 08 Jun 2008 02:28:57 +0800 [thread overview]
Message-ID: <484AD369.8030900@gmail.com> (raw)
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
next reply other threads:[~2008-06-07 18:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-07 18:28 RuoMu Hu [this message]
[not found] ` <85e5430e0806081002v48cb6625j1877f47c8b98a44e@mail.gmail.com>
2008-06-08 17:41 ` Confused about create_proc_entry RuoMu Hu
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=484AD369.8030900@gmail.com \
--to=huruomu@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
/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.