Lines Matching refs:pid
259 int pid = strtol(ptr, &ptr, 10);
261 if (pid == 0)
267 if (kill(pid, SIGKILL))
292 int cg_enter(const char *cgroup, int pid)
296 snprintf(pidbuf, sizeof(pidbuf), "%d", pid);
314 int pid, retcode;
316 pid = fork();
317 if (pid < 0) {
318 return pid;
319 } else if (pid == 0) {
327 waitpid(pid, &retcode, 0);
338 pid_t pid;
346 pid = sys_clone3(&args, sizeof(struct __clone_args));
352 if (pid < 0 && (errno == ENOSYS || errno == E2BIG))
355 return pid;
363 int clone_reap(pid_t pid, int options)
371 ret = waitid(P_PID, pid, &info, options | __WALL | __WNOTHREAD);
413 pid_t pid;
419 pid = clone_into_cgroup(cgroup_fd);
421 if (pid == 0)
424 return pid;
431 int pid;
433 pid = clone_into_cgroup_run_nowait(cgroup, fn, arg);
434 if (pid > 0)
435 return pid;
438 if (pid < 0 && errno != ENOSYS)
441 pid = fork();
442 if (pid == 0) {
451 return pid;
511 int set_oom_adj_score(int pid, int score)
516 sprintf(path, "/proc/%d/oom_score_adj", pid);
532 ssize_t proc_read_text(int pid, bool thread, const char *item, char *buf, size_t size)
536 if (!pid)
540 snprintf(path, sizeof(path), "/proc/%d/%s", pid, item);
545 int proc_read_strstr(int pid, bool thread, const char *item, const char *needle)
549 if (proc_read_text(pid, thread, item, buf, sizeof(buf)) < 0)
558 pid_t pid;
564 pid = clone_into_cgroup(cgroup_fd);
566 if (pid < 0)
569 if (pid == 0)
576 (void)clone_reap(pid, WEXITED);