Lines Matching refs:pid
28 static int check_pid(const pid_t pid, const char *dev_name, const char *short_dev_name) in check_pid() argument
36 snprintf(dirpath, sizeof(dirpath), "/proc/%d/fd", pid); in check_pid()
45 snprintf(fdpath, sizeof(fdpath), "/proc/%d/fd/%s", pid, direntry->d_name); in check_pid()
65 static int read_proc_info(const pid_t pid, pid_t *ppid, char *name, int max_size) in read_proc_info() argument
70 snprintf(path, sizeof(path), "/proc/%u/stat", pid); in read_proc_info()
86 static void report_proc(const pid_t pid, const char *dev_name) in report_proc() argument
91 if (read_proc_info(pid, &ppid, name, MAX_PATHNAME) && in report_proc()
94 pid, name, ppid, name2, dev_name); in report_proc()
103 pid_t pid; in debug_processes_using_device() local
120 pid = atoi(proc_dentry->d_name); in debug_processes_using_device()
121 switch(check_pid(pid, dev_name, short_dev_name)) { in debug_processes_using_device()
122 case 1: report_proc(pid, dev_name); in debug_processes_using_device()
124 case 2: report_proc(pid, short_dev_name); in debug_processes_using_device()