How does linux-kernel read proc/pid file?
linux-kernel, process, pwd, system-calls, ubuntu
Solution
/proc is a pseudo-filesystem, meaning that its contents are not "real" files. Instead, the contents are a representation of the kernel's internal data structures. Therefore the kernel doesn't need to read them - it can already access the data directly.
/proc is used by user-mode (i.e. non-kernel) programs such as `ps` to find out (for instance) about processes running on the system. There's a man page that describes much of what's available.
Problem
How and Where does linux-kernel read proc/pid file which shows all processes in the system. I found linux-source-2.6.31/fs/proc/ Here there are files, but it is hard to understand because it is really complicated. Can someone knows, how it works?