Home
last modified time | relevance | path

Searched refs:child_pid (Results 1 – 25 of 81) sorted by relevance

1234

/third_party/libuv/test/
Dtest-fork.c76 static void assert_wait_child(pid_t child_pid) { in assert_wait_child() argument
80 waited_pid = waitpid(child_pid, &child_stat, 0); in assert_wait_child()
85 ASSERT(child_pid == waited_pid); in assert_wait_child()
99 pid_t child_pid; in TEST_IMPL() local
102 child_pid = fork(); in TEST_IMPL()
103 ASSERT(child_pid != -1); in TEST_IMPL()
105 if (child_pid != 0) { in TEST_IMPL()
107 assert_wait_child(child_pid); in TEST_IMPL()
122 pid_t child_pid; in TEST_IMPL() local
134 child_pid = fork(); in TEST_IMPL()
[all …]
/third_party/ltp/testcases/kernel/syscalls/ptrace/
Dptrace10.c25 static pid_t child_pid; variable
38 child_pid = SAFE_FORK(); in run()
40 if (!child_pid) in run()
43 if (SAFE_WAITPID(child_pid, &status, WUNTRACED) != child_pid) in run()
47 SAFE_PTRACE(PTRACE_ATTACH, child_pid, NULL, NULL); in run()
48 SAFE_PTRACE(PTRACE_POKEUSER, child_pid, in run()
50 SAFE_PTRACE(PTRACE_POKEUSER, child_pid, in run()
53 addr = ptrace(PTRACE_PEEKUSER, child_pid, in run()
62 SAFE_PTRACE(PTRACE_DETACH, child_pid, NULL, NULL); in run()
63 SAFE_KILL(child_pid, SIGCONT); in run()
[all …]
Dptrace09.c26 static pid_t child_pid; variable
49 child_pid = SAFE_FORK(); in run()
51 if (!child_pid) { in run()
55 if (SAFE_WAITPID(child_pid, &status, 0) != child_pid) in run()
58 SAFE_PTRACE(PTRACE_POKEUSER, child_pid, in run()
60 SAFE_PTRACE(PTRACE_POKEUSER, child_pid, in run()
62 SAFE_PTRACE(PTRACE_CONT, child_pid, NULL, NULL); in run()
66 if (SAFE_WAITPID(child_pid, &status, 0) != child_pid) in run()
70 child_pid = 0; in run()
75 SAFE_PTRACE(PTRACE_CONT, child_pid, NULL, NULL); in run()
[all …]
Dptrace08.c46 static pid_t child_pid; variable
91 child_pid = SAFE_FORK(); in ptrace_try_kern_addr()
93 if (!child_pid) in ptrace_try_kern_addr()
96 if (SAFE_WAITPID(child_pid, &status, WUNTRACED) != child_pid) in ptrace_try_kern_addr()
100 SAFE_PTRACE(PTRACE_ATTACH, child_pid, NULL, NULL); in ptrace_try_kern_addr()
101 SAFE_PTRACE(PTRACE_POKEUSER, child_pid, in ptrace_try_kern_addr()
103 SAFE_PTRACE(PTRACE_POKEUSER, child_pid, in ptrace_try_kern_addr()
106 TEST(ptrace(PTRACE_POKEUSER, child_pid, in ptrace_try_kern_addr()
111 TEST(ptrace(PTRACE_POKEUSER, child_pid, in ptrace_try_kern_addr()
127 addr = ptrace(PTRACE_PEEKUSER, child_pid, in ptrace_try_kern_addr()
[all …]
Dptrace02.c23 int child_pid[2]; in verify_ptrace() local
25 child_pid[0] = SAFE_FORK(); in verify_ptrace()
26 if (!child_pid[0]) in verify_ptrace()
29 child_pid[1] = SAFE_FORK(); in verify_ptrace()
30 if (!child_pid[1]) { in verify_ptrace()
32 TEST(ptrace(PTRACE_ATTACH, child_pid[0], NULL, NULL)); in verify_ptrace()
51 SAFE_WAITPID(child_pid[1], NULL, 0); in verify_ptrace()
52 SAFE_KILL(child_pid[0], SIGKILL); in verify_ptrace()
53 SAFE_WAITPID(child_pid[0], NULL, 0); in verify_ptrace()
Dptrace01.c83 pid_t child_pid; in run() local
98 child_pid = SAFE_FORK(); in run()
100 if (!child_pid) in run()
103 SAFE_WAITPID(child_pid, &status, 0); in run()
108 else if ((ptrace(tc->request, child_pid, 0, 0)) == -1) in run()
110 tc->request, child_pid); in run()
112 SAFE_WAITPID(child_pid, &status, 0); in run()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/
D1-1.c46 int result, child_pid, tmp_errno, policy; in main() local
51 child_pid = fork(); in main()
52 if (child_pid == -1) { in main()
55 } else if (child_pid == 0) { in main()
59 if (sched_getparam(child_pid, &param) != 0) { in main()
61 kill(child_pid, SIGUSR1); in main()
80 result = sched_setparam(child_pid, &param); in main()
83 if (sched_getparam(child_pid, &param) != 0) { in main()
85 kill(child_pid, SIGUSR1); in main()
91 kill(child_pid, SIGUSR1); in main()
[all …]
D9-1.c99 static void kill_children(int *child_pid, int count) in kill_children() argument
104 kill(child_pid[i], SIGTERM); in kill_children()
105 free(child_pid); in kill_children()
110 int *child_pid, oldcount, newcount, shm_id, i; in main() local
126 child_pid = malloc(nb_cpu * sizeof(int)); in main()
156 child_pid[i] = fork(); in main()
157 if (child_pid[i] == -1) { in main()
159 kill_children(child_pid, i); in main()
161 } else if (child_pid[i] == 0) { in main()
170 child_pid[i] = fork(); in main()
[all …]
D2-2.c88 int *child_pid; in main() local
108 child_pid = malloc(nb_child * sizeof(int)); in main()
109 if (child_pid == NULL) { in main()
138 child_pid[i] = fork(); in main()
139 if (child_pid[i] == -1) { in main()
142 } else if (child_pid[i] == 0) { in main()
165 if (kill(child_pid[nb_child - 1], SIGTERM) != 0) { in main()
180 if (kill(child_pid[i], SIGKILL) != 0) { in main()
D27-1.c28 int result, child_pid, stat_loc; in main() local
36 child_pid = fork(); in main()
37 if (child_pid == -1) { in main()
40 } else if (child_pid == 0) { in main()
51 result = sched_setparam(child_pid, &param); in main()
D23-7.c25 int child_pid, stat_loc, old_priority; in main() local
34 child_pid = fork(); in main()
35 if (child_pid == -1) { in main()
38 } else if (child_pid == 0) { in main()
50 sched_setparam(child_pid, &param); in main()
D2-1.c87 int *child_pid; in main() local
107 child_pid = malloc(nb_child * sizeof(int)); in main()
134 child_pid[i] = fork(); in main()
135 if (child_pid[i] == -1) { in main()
138 } else if (child_pid[i] == 0) { in main()
161 if (kill(child_pid[nb_child - 1], SIGTERM) != 0) { in main()
176 if (kill(child_pid[i], SIGKILL) != 0) { in main()
/third_party/ltp/testcases/kernel/syscalls/clone/
Dclone03.c19 static int *child_pid; variable
23 *child_pid = getpid(); in child_fn()
38 TST_EXP_VAL(TST_RET, *child_pid, "pid(%d)", *child_pid); in verify_clone()
43 child_pid = SAFE_MMAP(NULL, sizeof(*child_pid), PROT_READ | PROT_WRITE, in setup()
49 if (child_pid) in cleanup()
50 SAFE_MUNMAP(child_pid, sizeof(*child_pid)); in cleanup()
Dclone01.c29 int status, child_pid; in verify_clone() local
34 child_pid = SAFE_WAIT(&status); in verify_clone()
36 if (child_pid == TST_RET) in verify_clone()
40 TST_RET, child_pid); in verify_clone()
/third_party/ltp/testcases/kernel/syscalls/getpid/
Dgetpid02.c18 static pid_t *child_pid; variable
39 *child_pid = getpid(); in verify_getpid()
46 if (*child_pid != pid) in verify_getpid()
47 tst_res(TFAIL, "child getpid() (%d) != parent fork() (%d)", *child_pid, pid); in verify_getpid()
54 child_pid = SAFE_MMAP(NULL, sizeof(pid_t), PROT_READ | PROT_WRITE, in setup()
60 SAFE_MUNMAP(child_pid, sizeof(pid_t)); in cleanup()
/third_party/libwebsockets/lib/plat/unix/
Dunix-spawn.c160 if (lsp->child_pid < 1) in lws_spawn_reap()
167 n = wait4(lsp->child_pid, &status, WNOHANG, &rusa); in lws_spawn_reap()
172 n = waitid(P_PID, (id_t)lsp->child_pid, &lsp->si, WEXITED | WNOHANG | WNOWAIT); in lws_spawn_reap()
175 lwsl_info("%s: child %d still running\n", __func__, lsp->child_pid); in lws_spawn_reap()
232 n = wait4(lsp->child_pid, &status, WNOHANG, &rusa); in lws_spawn_reap()
240 n = waitid(P_PID, (id_t)lsp->child_pid, &temp.si, WEXITED | WNOHANG); in lws_spawn_reap()
246 lsp->child_pid = -1; in lws_spawn_reap()
268 if (lsp->child_pid <= 0) in lws_spawn_piped_kill_child_process()
278 n = kill(-lsp->child_pid, SIGTERM); in lws_spawn_piped_kill_child_process()
280 lsp->child_pid, n, errno); in lws_spawn_piped_kill_child_process()
[all …]
/third_party/ltp/testcases/kernel/syscalls/fanotify/
Dfanotify07.c47 static pid_t child_pid[MAX_CHILDREN]; variable
73 child_pid[i] = SAFE_FORK(); in run_children()
74 if (!child_pid[i]) { in run_children()
89 if (!child_pid[i]) in stop_children()
92 SAFE_KILL(child_pid[i], SIGKILL); in stop_children()
96 if (!child_pid[i]) in stop_children()
99 SAFE_WAITPID(child_pid[i], &child_ret, 0); in stop_children()
104 child_pid[i] = 0; in stop_children()
/third_party/ltp/testcases/kernel/syscalls/setpgid/
Dsetpgid03.c52 int child_pid; in main() local
69 if ((child_pid = FORK_OR_VFORK()) == -1) in main()
72 if (child_pid == 0) { in main()
82 rval = setpgid(child_pid, getppid()); in main()
100 if ((child_pid = FORK_OR_VFORK()) == -1) in main()
103 if (child_pid == 0) { in main()
111 rval = setpgid(child_pid, getppid()); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/
D5-1.c27 int result = -1, child_pid; in main() local
31 child_pid = fork(); in main()
32 if (child_pid == -1) { in main()
35 } else if (child_pid == 0) { in main()
46 result = sched_getscheduler(child_pid); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/
D4-1.c28 int result = -1, child_pid; in main() local
32 child_pid = fork(); in main()
33 if (child_pid == -1) { in main()
36 } else if (child_pid == 0) { in main()
47 result = sched_getparam(child_pid, &param); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/
D21-1.c27 int result, child_pid, stat_loc; in main() local
33 child_pid = fork(); in main()
34 if (child_pid == -1) { in main()
37 } else if (child_pid == 0) { in main()
48 result = sched_setscheduler(child_pid, SCHED_FIFO, &param); in main()
D17-7.c34 int child_pid, stat_loc; in main() local
58 child_pid = fork(); in main()
59 if (child_pid == -1) { in main()
62 } else if (child_pid == 0) { in main()
73 sched_setscheduler(child_pid, policy, &param); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/
D3-1.c29 int result = -2, child_pid, stat_loc; in main() local
40 child_pid = fork(); in main()
41 if (child_pid == -1) { in main()
44 } else if (child_pid == 0) { in main()
55 result = sched_rr_get_interval(child_pid, &interval); in main()
/third_party/ltp/testcases/kernel/syscalls/capset/
Dcapset04.c19 static pid_t child_pid; variable
23 child_pid = SAFE_FORK(); in verify_capset()
24 if (!child_pid) in verify_capset()
29 header->pid = child_pid; in verify_capset()
33 SAFE_KILL(child_pid, SIGTERM); in verify_capset()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/
D11-1.c67 pid_t child_pid; in main() local
88 child_pid = fork(); in main()
89 if (child_pid == -1) { in main()
94 if (child_pid == 0) in main()
97 if (waitpid(child_pid, &child_stat, 0) == -1) { in main()

1234