I have to write a kernel module which imitates "multicast" using the / proc file system.
Basically the following conditions need to be supported:
1) Allow the / proc file to write one and allow multiple reads in the / proc file.
2) The module should have a buffer of last successful writing material. Each writing should be read from all readers.
Consider Scenario 2, an author wrote something and there are two readers (A and B), A read the content of the buffer and then to read it again, in this case go to waiting_key Should and wait for the next message, it should be not to get the same buffer again.
I need to keep a map, all the pids that already read the current buffer, and if they try to read again and the buffer does not change, they should be blocked Unless it is a new buffer. I am trying to explain that in a way I can save that information without a map. I have heard that there are some redundant fields inside the I / O system, if I already read the current buffer, then I can use one to flag the process.
Can someone give me a tip where I am looking for that area? How can I save information on the current process without having a "map" of Pid and buffers?
Thank you!
Do not try and keep it on the basis of PID - this is absolutely the wrong level of intangibles.
Every time the file has been opened, a new will be set file
, which is an example of an open file of references. In Structure File
,
structure file
inside the Personal_data indicator. This is what it is for
Comments
Post a Comment