LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-17-2004, 07:23 PM   #1
b123coder
Member
 
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Rep: Reputation: 15
read file from running kernel


can it be possible for a running kernel to read a file from a user space and
update its contents as it does for /proc file system?
i know it required to modify a kernel source? i dont know functions that can
be used to do this task? anybody knows it?
 
Old 11-18-2004, 04:05 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
You can't do this in the same way as for /proc as the procfs filesystem doesn't really exist.

If you want to provide automated generation of a file's contents, then the easiest way to do this is probably using a named pipe (see the popen and pclose manpages) in a user-space program.

To do this with the kernel, you'll need to modify the driver of the filesystem that the file is on, so I wouldn't go down that route as it's likely to seriously mess up your system during development. Unless you want to create the file somewhere under /proc, in which case it's quite easy to do in a new module.
 
  


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
how do I make a read-only file NOT read-only? robster Linux - General 1 02-17-2004 09:11 PM
kernel panic unable to mount root (yes ive read/read other posts) dmx9595 Linux - General 4 01-17-2004 05:07 AM
How can I read regular file in kernel module jooboo Programming 5 12-30-2003 07:11 PM
Can you create a config file from a running kernel? sparky8023 Linux - Newbie 3 12-03-2003 10:42 AM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 07:23 PM

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

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