Lines Matching refs:pid
32 pid_t pid = getpid(); in setrlimit_nproc() local
38 warnx("(pid=%d): Setting RLIMIT_NPROC=%ld", pid, n); in setrlimit_nproc()
41 err(EXIT_FAILURE, "(pid=%d): setrlimit(RLIMIT_NPROC)", pid); in setrlimit_nproc()
46 pid_t pid = fork(); in fork_child() local
48 if (pid < 0) in fork_child()
51 if (pid > 0) in fork_child()
52 return pid; in fork_child()
54 pid = getpid(); in fork_child()
56 warnx("(pid=%d): New process starting ...", pid); in fork_child()
59 err(EXIT_FAILURE, "(pid=%d): prctl(PR_SET_PDEATHSIG)", pid); in fork_child()
63 warnx("(pid=%d): Changing to uid=%d, gid=%d", pid, user, group); in fork_child()
66 err(EXIT_FAILURE, "(pid=%d): setgid(%d)", pid, group); in fork_child()
68 err(EXIT_FAILURE, "(pid=%d): setuid(%d)", pid, user); in fork_child()
70 warnx("(pid=%d): Service running ...", pid); in fork_child()
72 warnx("(pid=%d): Unshare user namespace", pid); in fork_child()
79 warnx("(pid=%d): Executing real service ...", pid); in fork_child()
82 err(EXIT_FAILURE, "(pid=%d): execve", pid); in fork_child()
91 pid_t pid; in main() local
99 pid = getpid(); in main()
101 warnx("(pid=%d) Starting testcase", pid); in main()
126 warn("(pid=%d): waitpid(%d)", pid, child[i]); in main()
147 pid, -child[i], WEXITSTATUS(wstatus[i])); in main()
150 pid, -child[i], WTERMSIG(wstatus[i])); in main()
155 warnx("(pid=%d): Test failed", pid); in main()
159 warnx("(pid=%d): Test passed", pid); in main()