LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-31-2007, 09:15 AM   #1
shogun1234
Member
 
Registered: May 2004
Posts: 226

Rep: Reputation: 15
proc_root_driver question


i practise to write a simple linux kernel module, creating a file in the /proc/driver folder. the code works fine, but i got a question.

my question is when looking up the proc_fs.h header file, the definition of proc_root_driver is set to NULL. why still i can create a file under /proc/driver w/t any error occurred?

my code is as below:

Code:
#include <linux/module.h>
#include <linux/proc_fs.h>

MODULE_LICENSE("GPL");

int
init(void)
{
printk(KERN_INFO "[create_proc_file_lkm]init function!\n");
/*create_proc_entry("my_test", 0644, NULL);*/
create_proc_entry("my_test", 0644, proc_root_driver);
return 0;
}

void
exit(void)
{
struct proc_root_driver *root_drv;
printk(KERN_INFO "[create_proc_file_lkm]exit function!\n");
remove_proc_entry("my_test", proc_root_driver);
return;
}

module_init(init);
module_exit(exit);
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two things: (Probably Simple) Grub question, and a gDesklets question Wilffo Linux - Software 3 05-20-2006 01:33 PM
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
Question 1 Firewall Log Question 2 Network Monitor Soulful93 Linux - Networking 4 08-04-2004 11:05 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration