Sameer D. Sahasrabuddhe wrote:
/proc is not a real directory on your hard-disk. The files under /proc exist only inside the running kernel, and are used get information and also send control messages to stuff happening inside the kernel.
Slightly incorrect. There are no "files". (Obligatory matrix quote - 'Don't try to change that file. Instead, realize the truth. There is no file'). Any operation (reading/writing etc) on the /proc enteries invokes the corresponding functions in the kernelspace, and the data (the contents of the 'file') is generated on the fly, usually from the relevant data structures that are maintained inside the kernel/modules. In case of writing to the /proc files, the corresponding data structures are modified.
I *think* a module may resort to actually fiddling with a 'real' file too, but that would be usually pointless. The above is the way that the /proc filesystem renders itself most useful.
Someone correct me if I'm wrong.
--gera.