The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: RuoMu Hu <huruomu@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Create proc entry under /proc/sys/kernel
Date: Mon, 09 Jun 2008 01:44:57 +0800	[thread overview]
Message-ID: <484C1A99.7070109@gmail.com> (raw)
In-Reply-To: <20080608111842.GA12240@martell.zuzino.mipt.ru>

Alexey Dobriyan wrote:
> On Sun, Jun 08, 2008 at 04:00:57PM +0800, RuoMu Hu wrote:
>   
>> Is it possible to create a proc entry under /proc/sys/kernel directly by 
>> create_proc_read_entry in the way shown below?
>>     
>
> No longer.
>
>   
>> test_pde = create_proc_read_entry("/proc/sys/kernel/test", 0, NULL,
>>                                    test_read_proc, NULL);
>> if (test_pde == NULL) {
>>    printk(KERN_ERR "Failed to create the test proc file.\n");
>>    return -ENOMEM;
>> }
>>
>> I'm using this in my kernel module but create_proc_read_entry always 
>> returns fail, while there's no problem creating proc entries directly under 
>> /proc.  The kernel source I'm building my kernel module against is 
>> 2.6.25.4.
>>     
>
> Use register_sysctl_table() for sysctls.
>   

Thank you for your hint, it really helped me.

Another question: Is it possible to add an entry under /proc/sys/kernel 
by register_sysctl_table() without modifying kernel source (adding an 
entry to the kern_table[] array in kernel/sysctl.c)?

Best regards,
Romu

  reply	other threads:[~2008-06-08 17:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08  8:00 Create proc entry under /proc/sys/kernel RuoMu Hu
2008-06-08 11:18 ` Alexey Dobriyan
2008-06-08 17:44   ` RuoMu Hu [this message]
2008-06-08 17:59     ` Alexey Dobriyan

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=484C1A99.7070109@gmail.com \
    --to=huruomu@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox