Hi,
Have you ever written (or encountered) code that uses the procfs
(the Linux /proc
file system) in non-trivial ways?
I have a very nice idea for a kernel patch, and I want to conduct some research and see code examples before I shape my idea.
Udi
EDIT
I'm looking for interesting code examples that would demonstrate advanced usage of the procfs
. By non-trivial I mean more than just reading a documented value.
My idea is to provide every process with an easy broadcast mechanism. For example, let's consider a process that runs multiple instances of rsync
and wants to check the transfer status (how many bytes have been transfered so far) for each child. Currently, I don't know of any way that can be done.
I intend to provide the process with a minimal interface to write data to the procfs
. That data would be placed under the PID directory. For example:
/procfs/1343/data_transfered/incoming
I can think of numerous advantage for this, mainly in the concurrency field.
By the way, if such a mechanism already exists, do tell...
(Thanks, Neil!)