Re: reading /proc values thorugh C code



Hiya,

uday kiran wrote:
I have been looking for quite some time to read /proc entries through
a c code. I understand that there are directories with pids. If there
is a library or a kernel structure that lets us to do so. Please let
me know.

There is nothing special about the /proc filesystem from a user code
perspective. You should be able to use the normal open(), read() & close()
operations. In fact you can just 'cd' there and type 'ls' or 'more' and so
on.

Or are you looking for a library that parses the contents of these files?

From the kernel you can just create a proc filesystem entry with
create_proc_read_entry() and associate your generator function at that
point.

Hope that helps,
John McCallum,
Edinburgh

.