]> git.baikalelectronics.ru Git - kernel.git/commit
proc: Implement /proc/thread-self to point at the directory of the current thread
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 31 Jul 2014 10:10:50 +0000 (03:10 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 4 Aug 2014 17:07:11 +0000 (10:07 -0700)
commit7858816a93e3b68dc1164f3c1ee46fe3da815d4a
tree414cffac820d04e4542dc7654e7ef188f00ba0b2
parent2a310dc411afc7f25eda992ba74020f8de589de0
proc: Implement /proc/thread-self to point at the directory of the current thread

/proc/thread-self is derived from /proc/self.  /proc/thread-self
points to the directory in proc containing information about the
current thread.

This funtionality has been missing for a long time, and is tricky to
implement in userspace as gettid() is not exported by glibc.  More
importantly this allows fixing defects in /proc/mounts and /proc/net
where in a threaded application today they wind up being empty files
when only the initial pthread has exited, causing problems for other
threads.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/proc/Makefile
fs/proc/base.c
fs/proc/inode.c
fs/proc/internal.h
fs/proc/root.c
fs/proc/thread_self.c [new file with mode: 0644]
include/linux/pid_namespace.h