Skip to contentSkip to conversation

read_proc_t and file_operations in procfs

DISCUSSION Hua Siyuan 2 participants 2 messages Jul 21, 2013 1 message not in the archive

lore
Share & tools
lore

Hua Siyuan

author
#1 lore raw
In reply to a message not in the archive

Hi All,

I'm now studying proc file system. I now know that read_proc_t function is called when the proofs file is read, and so for write_proc_t function when the proofs file is written to. But I also find the file_operaitons* field in the definition of proc_dir_entry, and this example code (http://linux.die.net/lkmpg/x810.html).

So I'm confused that what happened if I provide both read_proc_t function, and the read function in file_operations structure? Thanks very much.

Best,
Siyuan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130721/9fdc6f53/attachment.html

#2 lore raw

Greetings

Didn't they remove {read,write}_proc_t in linux-3.10? You may have to provide full file_operations for a proc file.

Best Regards
-Emil

Quoted 11 lines · Hua Siyuan

Hi All,

I'm now studying proc file system. I now know that read_proc_t function is called when the proofs file is read, and so for write_proc_t function when the proofs file is written to. But I also find the file_operaitons* field in the definition of proc_dir_entry, and this example code (
http://linux.die.net/lkmpg/x810.html).

So I'm confused that what happened if I provide both read_proc_t function, and the read function in file_operations structure? Thanks very much.

Quoted 9 lines

Best,
Siyuan

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130721/bf10455e/attachment.html