task_current redundant field

Posted by user341940 on Stack Overflow See other posts from Stack Overflow or by user341940
Published on 2010-05-15T13:59:48Z Indexed on 2010/05/15 14:04 UTC
Read the original article Hit count: 119

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

© Stack Overflow or respective owner

Related posts about kernel-programming

Related posts about kernel-module