Specifying multiple files with LD_PRELOAD
According to the ld.so
manpage, it is a space separated list. So:
LD_PRELOAD="path1 path2"
ought to work.
One option is to have the overridden version of both getpid
and getid
in a single .so
which you give to LD_PRELOAD
.