Lines Matching refs:pid
31 pid_t pid;
36 static int pid_is_exec(pid_t pid, const char *name)
42 sprintf(buf, "/proc/%u/exe", pid);
54 static int pid_is_user(int pid, int uid)
59 sprintf(buf, "/proc/%u", pid);
65 static int pid_is_cmd(pid_t pid, const char *name)
71 sprintf(fname, "/proc/%u/stat", pid);
87 static void check(int pid)
91 if (execname && !pid_is_exec(pid, execname)) {
94 if (userspec && !pid_is_user(pid, user_id)) {
97 if (cmdname && !pid_is_cmd(pid, cmdname)) {
102 p->pid = pid;
109 unsigned pid;
113 if (fscanf(f, "%u", &pid) == 1)
114 check(pid);
124 int foundany, pid;
135 pid = bb_strtou(entry->d_name, NULL, 10);
139 check(pid);
174 if (kill(p->pid, signal_nr) == 0) {
175 p->pid = - p->pid;
178 bb_perror_msg("warning: killing process %u", p->pid);
182 printf("stopped %s (pid", what);
184 if (p->pid < 0)
185 printf(" %u", - p->pid);
295 printf("%s already running\n%d\n", execname, found->pid);
303 pid_t pid = vfork();
304 if (pid < 0) /* error */
306 if (pid != 0) {