Lines Matching defs:pid
66 void Process::getProcessName(int pid, char *buffer, size_t max) {
68 snprintf(buffer, max, "/proc/%d/cmdline", pid);
79 int Process::checkFileDescriptorSymLinks(int pid, const char *mountPoint) {
80 return checkFileDescriptorSymLinks(pid, mountPoint, NULL, 0);
83 int Process::checkFileDescriptorSymLinks(int pid, const char *mountPoint, char *openFilename, size_t max) {
88 sprintf(path, "/proc/%d/fd", pid);
124 int Process::checkFileMaps(int pid, const char *mountPoint) {
125 return checkFileMaps(pid, mountPoint, NULL, 0);
128 int Process::checkFileMaps(int pid, const char *mountPoint, char *openFilename, size_t max) {
132 sprintf(buffer, "/proc/%d/maps", pid);
154 int Process::checkSymLink(int pid, const char *mountPoint, const char *name) {
158 sprintf(path, "/proc/%d/%s", pid, name);
190 int pid = getPid(de->d_name);
193 if (pid == -1)
195 getProcessName(pid, name, sizeof(name));
199 if (checkFileDescriptorSymLinks(pid, path, openfile, sizeof(openfile))) {
200 SLOGE("Process %s (%d) has open file %s", name, pid, openfile);
201 } else if (checkFileMaps(pid, path, openfile, sizeof(openfile))) {
202 SLOGE("Process %s (%d) has open filemap for %s", name, pid, openfile);
203 } else if (checkSymLink(pid, path, "cwd")) {
204 SLOGE("Process %s (%d) has cwd within %s", name, pid, path);
205 } else if (checkSymLink(pid, path, "root")) {
206 SLOGE("Process %s (%d) has chroot within %s", name, pid, path);
207 } else if (checkSymLink(pid, path, "exe")) {
208 SLOGE("Process %s (%d) has executable path within %s", name, pid, path);
214 SLOGW("Sending %s to process %d", strsignal(signal), pid);
215 kill(pid, signal);