Pisprocdir - test if a directory is the /proc directory
#include <libproc.h>
int Pisprocdir(ps_prochandle_t *Pr, const char *dir);
The Pr argument identifies a live victim process attached to the controlling process by the create and grab interfaces. For more information, see the Pcreate(3PROC) and Pgrab(3PROC) man pages.
The Pisprocdir() function returns true (non-zero) if the specified file name string in the dir argument is the actual /proc directory.
When controlling a victim process, it is necessary to know whether the victim has attempted to open one of its own /proc files or one of the /proc files of some other process. Since /proc can be loopback mounted with a name other than /proc, the name of the directory under which the victim opens a file can be tested for whether or not it is actually /proc by calling the Pisprocdir() function. The truss(1) command uses this interface in order to relinquish control of a process that is being controlled by another controlling process.
The Pisprocdir() function returns non-zero or true if the specified file name is the /proc directory present under the root directory of the victim process. Else, it returns 0 or false. There are no error returns.
See attributes(7) for descriptions of the following attributes:
|
libproc.h(3HEAD), libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), proc(5)