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