Do files in /proc/PID directory have their own proc_dir_entry instance?
Do files in /proc/PID
directory (including /proc/PID
) have their own proc_dir_entry
instance?
As I known, each normal file in /proc
including /proc
has their proc_dir_entry
instance.
(The instance address is stored in proc_inode.pde
.)
After surfing the procfs
source code in Linux 2.6.11, seems that the kernel doesn't create a corresponding proc_dir_entry
instance for each pid
directory in /proc
and each file in pid
directory.
If it's not true, which file in the ke开发者_如何转开发rnel source code shows that the kernel create proc_dir_entry
instance for pid
directory in /proc
.
I think you're right, it looks like the pid entries are handled differently. See fs/proc/base.c
.
Yes, every process has its proc_dir_entry that is /proc/PID/task directory in common.
精彩评论