corbin
corbin

Reputation: 1556

Where is the Linux kernel code that handles creation and deletion of /proc/pid/fd/# links?

Just looking for where this is handled. I have a similar need to track open fd's without scanning the /proc system.

Upvotes: 0

Views: 103

Answers (1)

Tsyvarev
Tsyvarev

Reputation: 66278

The code which fill information under /proc/<PID>/fd is in file fs/proc/fd.c.

I suggest to look into the function proc_readfd_common, which iterates over the file descriptors available for the process. This function is eventually called when directory /proc/<PID>/fd is read.

Upvotes: 2

Related Questions