Linux - Programmatically write to a proc file

Posted by Zach on Stack Overflow See other posts from Stack Overflow or by Zach
Published on 2010-03-28T14:08:44Z Indexed on 2010/03/28 14:13 UTC
Read the original article Hit count: 208

I have found several examples online where we can create a proc file, assign read and write methods that are called every time the proc file is opened for read or written to.

However, I can't seem to find any documentation on how to programatically write to a proc file. Ideally, I would like to add a timestamp with other user details every time the proc file is opened for read or for write. Again, I've found where I can add the read and write functions that are triggered when the proc file is opened, but I can't find documentation on how to actually write to a proc file programatically. This would be different from a regular IO read/write, correct?

© Stack Overflow or respective owner

Related posts about kernel-module

Related posts about linux-kernel