Yuncy
Yuncy

Reputation: 791

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.
Is this true?

If it's not true, which file in the kernel source code shows that the kernel create proc_dir_entry instance for pid directory in /proc.

Upvotes: 0

Views: 1193

Answers (2)

Kevin
Kevin

Reputation: 1

Yes, every process has its proc_dir_entry that is /proc/PID/task directory in common.

Upvotes: 0

mpe
mpe

Reputation: 2730

I think you're right, it looks like the pid entries are handled differently. See fs/proc/base.c.

Upvotes: 1

Related Questions