I would like to implement a linux filesystem, either with FUSE or as a kernel module, which is aware of the process which is looking at it so that it can tailor the contents of the filesystem to the accessing process.
A concrete example of this kind of behavior is in /proc/self
which is a symlink to /proc/PID
, where PID is the current processes PID.
Is there a FUSE or kernel API that will allow me to do this?
The implementation for /proc/self
is here:
https://github.com/torvalds/linux/blob/v4.3/fs/proc/self.c
It uses all sorts of internal kernel juju, so perhaps FUSE is out of the question.