views:

31

answers:

0

Hi,

I'm writing a kernel module that reads from a /proc file. When someone writes into the /proc file the reader will read it, but if it reads again while there is no "new" write, it should be blocked. In order to remember if we already read, i need to keep a map of the latest buffer that process read.

To avoid that, I was told that there might be some redundant field inside the current-> (task_struct struct) that i can use to my benefits in order to save some states on the current process.

How can I find such fields ? and how can i avoid them being overwritten ? I read somewhere that i can use the offset field inside the struct in order to save my information there and i need to block lseek operations so that field will stay untouched.

How can I do so ? and where is that offset field, i can't find it inside the task_Struct.

Thanks

and I need to save for each process some information in order to map it against other information.

I can write a ma