hi,
i wrote a module that add an entry and a file in /proc fs.
i need to read this file from the kernel (tcp_output.c).
how do i do that?
b.t.w. i'm working with version 2.6.7
thanks,
shimrit
Printable View
hi,
i wrote a module that add an entry and a file in /proc fs.
i need to read this file from the kernel (tcp_output.c).
how do i do that?
b.t.w. i'm working with version 2.6.7
thanks,
shimrit
To read info from the proc filesystem, you use cat.
Since these are technically files, I'd imagine that you can read them as per a normal file in your C program. Keep in mind, though, that they are constantly changing.Code:cat /proc/cpuinfo
From your question you have your own kernel module which register /proc file and write to it. And you want to access that info from the kernel code tcp_output.c? Is that the question? If this is your question read this in how to implement it.Quote:
I wrote a module that add an entry and a file in /proc fs.
i need to read this file from the kernel (tcp_output.c).
how do i do that?
http://www.faqs.org/docs/kernel/x762.html