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 04-16-2012, 11:46 PM   #1
amitk.gupta09
Member
 
Registered: Aug 2011
Location: pune
Posts: 37

Rep: Reputation: Disabled
Proc file system


i wrote a driver who create a directory named abc and one file named xyz1 under this directory also.This directory is at /proc/.
When i am trying to write on this file my driver proc_write function getting executed continually.I wrote simple general code under proc_write function.

i am writing to the file using this command

echo start>/proc/abc/xyz1


Please help me ...
 
Old 04-17-2012, 01:44 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Why are you creating/writing files under /proc ? .. this is not a physical file system, just a representation of information from the kernel.
 
Old 04-17-2012, 01:48 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by amitk.gupta09 View Post
i wrote a driver who create a directory named abc and one file named xyz1 under this directory also.This directory is at /proc/.
When i am trying to write on this file my driver proc_write function getting executed continually.I wrote simple general code under proc_write function.

i am writing to the file using this command

echo start>/proc/abc/xyz1
Please help me ...
I'm a bit confused; you wrote a kernel driver (which means you're a skilled programmer), but can't figure out how to debug your own code? And as kbp asked, why are you writing files to /proc? If you need help with your code, post it.
 
Old 04-17-2012, 05:01 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I think the OP is trying to say that his driver creates the virtual file(s) in the /proc filesystem. While I am no kernel development expert, this seems like a reasonable thing for a driver to do. If I further understand the crux of the question, it sounds like the OP is saying that the callback in the driver is being called repeatedly whenever a value gets written from userspace. My guess is that the callback must return a correct status to indicate that it has consumed the input, and should not be bothered about it any further.

Whatever the problem, I concur with TB0ne that the only way for anyone to provide much insight is to post the relevant section(s) of code, retaining all formatting by posting in [CODE][/CODE] tags, of course.

--- rod.
 
  


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
Cannot read proc file system cmccullo Linux - Newbie 2 01-27-2012 02:39 PM
proc file system and ps alanTuring Linux - Kernel 1 01-28-2011 08:28 AM
PPID from /proc file system? sanjaykhuntia Linux - Enterprise 1 10-26-2007 03:40 PM
How to get these information using proc file system. cppkid Programming 1 10-02-2005 07:55 PM
Is proc file system standardized across distro alred Programming 6 03-27-2005 03:19 PM

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

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