Results 1 to 3 of 3
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?
...
- 01-25-2005 #1Just Joined!
- Join Date
- Sep 2004
- Posts
- 6
read from /proc
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
- 01-25-2005 #2
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
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 01-26-2005 #3Just Joined!
- Join Date
- Jan 2005
- Location
- Toronto, ON, Canada
- Posts
- 79
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.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


Reply With Quote
