I was tinkering around with the /proc filesystem in Linux, and I came across /proc/self, which is a symbolic link to the process directory of the current process. I would like to know how it is implemented. One solution would be to change that symlink on every context switch, but that's obviously very expensive as it involves a disk access.
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
|||
|
|
|
http://lxr.linux.no/linux+v3.2.9/fs/proc/base.c#L2482 is the current implementation. The |
|||
|
|
|
Files in If you're programmatically inclined, you can read the implementation of |
|||
|
|