How to use /proc

Greg KH greg at kroah.com
Sun Feb 5 17:52:47 EST 2012


A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Sun, Feb 05, 2012 at 05:14:02PM -0500, Surenkumar Nihalani wrote:
> Hey Daniel, 
> 
> Thanks for the quick reply.
> 
> The IBM tutorial helps me writing the function for handling user reads
> and writes to your corresponding proc file. It doesn't help in terms
> of opening and writing from the kernel side.  the example you provided
> just creates a proc entry. It doesn't tell me how to write to it.

You do not write/read proc files from within the kernel, that makes no
sense.  This is a virtual file, just modify the value that the file is
showing.

And please, never create new proc files, unless it really is for process
information, use debugfs for "playing around" type things, that is what
it is there for.

greg k-h



More information about the Kernelnewbies mailing list