LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-14-2005, 05:44 AM   #1
linux_lover2005
Member
 
Registered: Dec 2004
Posts: 44

Rep: Reputation: 15
How to read from /proc entry in another kernel module?


Hello all,
I have written one /proc file entry kernel module program which creats ff file under /proc. When i open and write to that file using fwrite from normal user file program it works. Now i want to read the contents of /proc/ff file in another kenrel module. How can i do that?
I use following functions to create/read/write/close /proc/ff file and assigned those to ff_file_operations structure.

static int ff_open(struct inode *inodep, struct file *filp);
static int ff_release(struct inode *inodep, struct file *filp);
static ssize_t ff_read(struct file *filp, char *buf, size_t count, loff_t *ppos);
static ssize_t ff_write(struct file *filp, const char *buf, size_t count, loff_t *ppos);


static struct file_operations ff_file_operations = {
open: ff_open,
release: ff_release,
read: ff_read,
write: ff_write,
};
 
  


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
read routing table in kernel module? cranium2004 Programming 0 03-15-2005 07:15 AM
module.conf entry not loading thompsonrj Linux - Hardware 2 01-31-2004 11:06 PM
How can I read regular file in kernel module jooboo Programming 5 12-30-2003 07:11 PM
Nautilus will not read /proc directory RottenMutt Linux - General 1 07-10-2003 01:22 AM
writing to proc module dmaxj Linux - General 5 07-02-2003 09:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:22 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