ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.