Lines Matching refs:child
59 ATF_REQUIRE(msg_write_child(info " to child " # fds, &fds, &msg, sizeof(msg)) == 0)
75 "Verify SIGSTOP followed by _exit(2) in a child");
82 pid_t child, wpid;
88 ATF_REQUIRE((child = fork()) != -1);
89 if (child == 0) {
90 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
93 printf("Before raising %s from child\n", strsignal(sigval));
96 printf("Before exiting of the child process\n");
99 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
101 printf("Before calling %s() for the child\n", TWAIT_FNAME);
102 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
106 printf("Before resuming the child process where it left off and "
108 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
110 printf("Before calling %s() for the child\n", TWAIT_FNAME);
111 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
115 printf("Before calling %s() for the child\n", TWAIT_FNAME);
116 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
123 "Verify SIGSTOP followed by _exit(2) in a child");
140 pid_t child, wpid;
147 ATF_REQUIRE((child = fork()) != -1);
148 if (child == 0) {
149 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
158 printf("Before raising %s from child\n", strsignal(sigval));
163 printf("Before exiting of the child process\n");
166 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
168 printf("Before calling %s() for the child\n", TWAIT_FNAME);
169 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
173 printf("Before resuming the child process where it left off and with "
175 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigsent) != -1);
177 printf("Before calling %s() for the child\n", TWAIT_FNAME);
178 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
182 printf("Before calling %s() for the exited child\n", TWAIT_FNAME);
183 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
190 "Verify SIGSTOP followed by termination by a signal in a child");
196 pid_t child, wpid;
202 ATF_REQUIRE((child = fork()) != -1);
203 if (child == 0) {
204 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
207 printf("Before raising %s from child\n", strsignal(sigval));
214 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
216 printf("Before calling %s() for the child\n", TWAIT_FNAME);
217 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
221 printf("Before resuming the child process where it left off and with "
223 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigsent) != -1);
225 printf("Before calling %s() for the child\n", TWAIT_FNAME);
226 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
230 printf("Before calling %s() for the exited child\n", TWAIT_FNAME);
231 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
238 "Verify SIGSTOP followed by SIGCONT and _exit(2) in a child");
245 pid_t child, wpid;
251 ATF_REQUIRE((child = fork()) != -1);
252 if (child == 0) {
253 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
256 printf("Before raising %s from child\n", strsignal(sigval));
259 printf("Before raising %s from child\n", strsignal(sigsent));
262 printf("Before exiting of the child process\n");
265 printf("Parent process PID=%d, child's PID=%d\n", getpid(),child);
267 printf("Before calling %s() for the child\n", TWAIT_FNAME);
268 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
272 printf("Before resuming the child process where it left off and "
274 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
276 printf("Before calling %s() for the child\n", TWAIT_FNAME);
277 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
281 printf("Before resuming the child process where it left off and "
283 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
285 printf("Before calling %s() for the child\n", TWAIT_FNAME);
286 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
290 printf("Before calling %s() for the exited child\n", TWAIT_FNAME);
291 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
371 printf("Tell the tracer child should have exited\n");
376 printf("Wait from tracer child to complete waiting for tracee\n");
457 printf("Wait for the tracer process (direct child) to exit calling "
502 "Assert that tracer parent can PT_ATTACH to its child");
561 "Assert that tracer child can PT_ATTACH to its parent");
582 printf("Attach to parent PID %d with PT_ATTACH from child\n",
656 printf("Wait for child to record its parent identifier (pid)\n");
662 /* No IPC to communicate with the child */
705 printf("Tell the tracer child should have exited\n");
708 printf("Wait from tracer child to complete waiting for tracee\n");
775 printf("Wait for child to record its parent identifier (pid)\n");
781 /* No IPC to communicate with the child */
899 printf("Wait for child to record its parent identifier (pid)\n");
978 pid_t child, wpid;
986 ATF_REQUIRE((child = fork()) != -1);
987 if (child == 0) {
988 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
991 printf("Before raising %s from child\n", strsignal(sigval));
994 printf("Before exiting of the child process\n");
997 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
999 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1000 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1005 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
1006 ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
1009 printf("Before resuming the child process where it left off and "
1011 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1013 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1014 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1018 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1019 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1033 pid_t child, wpid;
1041 ATF_REQUIRE((child = fork()) != -1);
1042 if (child == 0) {
1043 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1046 printf("Before raising %s from child\n", strsignal(sigval));
1049 printf("Before exiting of the child process\n");
1052 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1054 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1055 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1060 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
1061 ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
1064 printf("Before resuming the child process where it left off and "
1066 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1068 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1069 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1073 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1074 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1088 pid_t child, wpid;
1098 ATF_REQUIRE((child = fork()) != -1);
1099 if (child == 0) {
1100 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1103 printf("Before raising %s from child\n", strsignal(sigval));
1106 printf("Before exiting of the child process\n");
1109 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1111 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1112 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1117 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
1118 ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
1121 printf("Before resuming the child process where it left off and "
1123 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1125 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1126 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1130 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1131 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1145 pid_t child, wpid;
1153 ATF_REQUIRE((child = fork()) != -1);
1154 if (child == 0) {
1155 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1158 printf("Before raising %s from child\n", strsignal(sigval));
1161 printf("Before exiting of the child process\n");
1164 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1166 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1167 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1172 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
1173 ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
1176 printf("Before resuming the child process where it left off and "
1178 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1180 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1181 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1185 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1186 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1200 pid_t child, wpid;
1208 ATF_REQUIRE((child = fork()) != -1);
1209 if (child == 0) {
1210 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1213 printf("Before raising %s from child\n", strsignal(sigval));
1216 printf("Before exiting of the child process\n");
1219 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1221 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1222 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1227 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
1228 ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
1231 printf("Before resuming the child process where it left off and "
1233 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1235 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1236 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1240 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1241 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1255 pid_t child, wpid;
1263 ATF_REQUIRE((child = fork()) != -1);
1264 if (child == 0) {
1265 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1268 printf("Before raising %s from child\n", strsignal(sigval));
1271 printf("Before exiting of the child process\n");
1274 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1276 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1277 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1282 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
1283 ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
1286 printf("Before resuming the child process where it left off and "
1288 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1290 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1291 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1295 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1296 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1313 pid_t child, child2, wpid;
1323 ATF_REQUIRE((child = fork()) != -1);
1324 if (child == 0) {
1325 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1328 printf("Before raising %s from child\n", strsignal(sigval));
1341 printf("Before exiting of the child process\n");
1344 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1346 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1347 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1351 printf("Enable PTRACE_FORK in EVENT_MASK for the child %d\n", child);
1353 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
1355 printf("Before resuming the child process where it left off and "
1357 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1359 printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
1360 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1364 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
1370 printf("Before calling %s() for the forkee %d of the child %d\n",
1371 TWAIT_FNAME, child2, child);
1379 ATF_REQUIRE_EQ(state.pe_other_pid, child);
1385 printf("Before resuming the child process where it left off and "
1387 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1401 printf("Before calling %s() for the child - expected stopped "
1403 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1407 printf("Before resuming the child process where it left off and "
1409 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1411 printf("Before calling %s() for the child - expected exited\n",
1413 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1417 printf("Before calling %s() for the child - expected no process\n",
1419 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1436 pid_t child, child2, wpid;
1444 ATF_REQUIRE((child = fork()) != -1);
1445 if (child == 0) {
1446 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1449 printf("Before raising %s from child\n", strsignal(sigval));
1462 printf("Before exiting of the child process\n");
1465 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1467 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1468 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1472 printf("Set empty EVENT_MASK for the child %d\n", child);
1474 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
1476 printf("Before resuming the child process where it left off and "
1478 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1480 printf("Before calling %s() for the child - expected stopped "
1482 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1486 printf("Before resuming the child process where it left off and "
1488 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1490 printf("Before calling %s() for the child - expected exited\n",
1492 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1496 printf("Before calling %s() for the child - expected no process\n",
1498 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1515 pid_t child, child2, wpid;
1527 ATF_REQUIRE((child = fork()) != -1);
1528 if (child == 0) {
1529 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1532 printf("Before raising %s from child\n", strsignal(sigval));
1545 printf("Before exiting of the child process\n");
1548 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1550 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1551 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1555 printf("Enable PTRACE_VFORK in EVENT_MASK for the child %d\n", child);
1557 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
1559 printf("Before resuming the child process where it left off and "
1561 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1563 printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
1564 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1568 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
1574 printf("Before calling %s() for the forkee %d of the child %d\n",
1575 TWAIT_FNAME, child2, child);
1583 ATF_REQUIRE_EQ(state.pe_other_pid, child);
1589 printf("Before resuming the child process where it left off and "
1591 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1605 printf("Before calling %s() for the child - expected stopped "
1607 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1611 printf("Before resuming the child process where it left off and "
1613 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1615 printf("Before calling %s() for the child - expected exited\n",
1617 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1621 printf("Before calling %s() for the child - expected no process\n",
1623 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1640 pid_t child, child2, wpid;
1648 ATF_REQUIRE((child = fork()) != -1);
1649 if (child == 0) {
1650 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1653 printf("Before raising %s from child\n", strsignal(sigval));
1666 printf("Before exiting of the child process\n");
1669 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1671 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1672 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1676 printf("Set empty EVENT_MASK for the child %d\n", child);
1678 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
1680 printf("Before resuming the child process where it left off and "
1682 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1684 printf("Before calling %s() for the child - expected stopped "
1686 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1690 printf("Before resuming the child process where it left off and "
1692 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1694 printf("Before calling %s() for the child - expected exited\n",
1696 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1700 printf("Before calling %s() for the child - expected no process\n",
1702 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1718 pid_t child, child2, wpid;
1728 ATF_REQUIRE((child = fork()) != -1);
1729 if (child == 0) {
1730 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1733 printf("Before raising %s from child\n", strsignal(sigval));
1746 printf("Before exiting of the child process\n");
1749 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1751 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1752 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1756 printf("Enable PTRACE_VFORK_DONE in EVENT_MASK for the child %d\n",
1757 child);
1759 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
1761 printf("Before resuming the child process where it left off and "
1763 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1765 printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
1766 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1770 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
1776 printf("Before resuming the child process where it left off and "
1778 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1780 printf("Before calling %s() for the child - expected stopped "
1782 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1786 printf("Before resuming the child process where it left off and "
1788 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1790 printf("Before calling %s() for the child - expected exited\n",
1792 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1796 printf("Before calling %s() for the child - expected no process\n",
1798 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1814 pid_t child, child2, wpid;
1824 ATF_REQUIRE((child = fork()) != -1);
1825 if (child == 0) {
1826 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1829 printf("Before raising %s from child\n", strsignal(sigval));
1842 printf("Before exiting of the child process\n");
1845 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1847 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1848 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1852 printf("Enable PTRACE_VFORK in EVENT_MASK for the child %d\n", child);
1854 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
1856 printf("Before resuming the child process where it left off and "
1858 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1860 printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
1861 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1865 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
1871 printf("Before resuming the child process where it left off and "
1873 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1875 printf("Before calling %s() for the child - expected stopped "
1877 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1881 printf("Before resuming the child process where it left off and "
1883 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1885 printf("Before calling %s() for the child - expected exited\n",
1887 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1891 printf("Before calling %s() for the child - expected no process\n",
1893 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1907 pid_t child, wpid;
1921 ATF_REQUIRE((child = fork()) != -1);
1922 if (child == 0) {
1923 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1928 printf("Before raising %s from child\n", strsignal(sigval));
1931 printf("Before exiting of the child process\n");
1934 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
1936 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1937 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1942 child, getpid());
1943 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
1948 printf("Before resuming the child process where it left off and "
1950 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
1952 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1953 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
1957 printf("Before calling %s() for the child\n", TWAIT_FNAME);
1958 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
1972 pid_t child, wpid;
1986 ATF_REQUIRE((child = fork()) != -1);
1987 if (child == 0) {
1988 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
1993 printf("Before raising %s from child\n", strsignal(sigval));
1996 printf("Before exiting of the child process\n");
1999 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2001 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2002 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2007 child, getpid());
2008 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2013 printf("Before resuming the child process where it left off and "
2015 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2017 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2018 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2022 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2023 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2037 pid_t child, wpid;
2051 ATF_REQUIRE((child = fork()) != -1);
2052 if (child == 0) {
2053 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2058 printf("Before raising %s from child\n", strsignal(sigval));
2061 printf("Before exiting of the child process\n");
2064 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2066 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2067 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2072 child, getpid());
2073 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2078 printf("Before resuming the child process where it left off and "
2080 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2082 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2083 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2087 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2088 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2102 pid_t child, wpid;
2116 ATF_REQUIRE((child = fork()) != -1);
2117 if (child == 0) {
2118 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2123 printf("Before raising %s from child\n", strsignal(sigval));
2126 printf("Before exiting of the child process\n");
2129 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2131 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2132 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2137 child, getpid());
2138 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2143 printf("Before resuming the child process where it left off and "
2145 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2147 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2148 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2152 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2153 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2167 pid_t child, wpid;
2181 ATF_REQUIRE((child = fork()) != -1);
2182 if (child == 0) {
2183 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2186 printf("Before raising %s from child\n", strsignal(sigval));
2191 printf("Before exiting of the child process\n");
2194 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2196 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2197 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2204 child, getpid());
2205 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2207 printf("Before resuming the child process where it left off and "
2209 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2211 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2212 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2216 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2217 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2231 pid_t child, wpid;
2245 ATF_REQUIRE((child = fork()) != -1);
2246 if (child == 0) {
2247 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2250 printf("Before raising %s from child\n", strsignal(sigval));
2255 printf("Before exiting of the child process\n");
2258 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2260 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2261 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2268 child, getpid());
2269 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2271 printf("Before resuming the child process where it left off and "
2273 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2275 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2276 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2280 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2281 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2295 pid_t child, wpid;
2309 ATF_REQUIRE((child = fork()) != -1);
2310 if (child == 0) {
2311 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2314 printf("Before raising %s from child\n", strsignal(sigval));
2319 printf("Before exiting of the child process\n");
2322 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2324 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2325 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2332 child, getpid());
2333 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2335 printf("Before resuming the child process where it left off and "
2337 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2339 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2340 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2344 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2345 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2359 pid_t child, wpid;
2373 ATF_REQUIRE((child = fork()) != -1);
2374 if (child == 0) {
2375 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2378 printf("Before raising %s from child\n", strsignal(sigval));
2383 printf("Before exiting of the child process\n");
2386 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2388 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2389 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2396 child, getpid());
2397 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2399 printf("Before resuming the child process where it left off and "
2401 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2403 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2404 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2408 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2409 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2423 pid_t child, wpid;
2436 ATF_REQUIRE((child = fork()) != -1);
2437 if (child == 0) {
2438 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2441 printf("Before raising %s from child\n", strsignal(sigval));
2444 printf("Before exiting of the child process\n");
2447 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2449 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2450 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2455 child, getpid());
2456 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
2465 printf("Before resuming the child process where it left off and "
2467 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2469 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2470 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2474 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2475 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2489 pid_t child, wpid;
2497 ATF_REQUIRE((child = fork()) != -1);
2498 if (child == 0) {
2499 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2504 printf("Before raising %s from child\n", strsignal(sigval));
2507 printf("Before exiting of the child process\n");
2510 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2512 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2513 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2518 child, getpid());
2520 lookup_me = ptrace(PT_READ_D, child, &lookup_me, 0);
2526 printf("Before resuming the child process where it left off and "
2528 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2530 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2531 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2535 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2536 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2550 pid_t child, wpid;
2560 ATF_REQUIRE((child = fork()) != -1);
2561 if (child == 0) {
2562 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2568 printf("Before raising %s from child\n", strsignal(sigval));
2571 printf("Before exiting of the child process\n");
2574 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2576 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2577 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2582 child, getpid());
2584 lookup_me1 = ptrace(PT_READ_D, child, &lookup_me1, 0);
2591 child, getpid());
2593 lookup_me2 = ptrace(PT_READ_D, child, &lookup_me2, 0);
2599 printf("Before resuming the child process where it left off and "
2601 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2603 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2604 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2608 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2609 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2623 pid_t child, wpid;
2635 ATF_REQUIRE((child = fork()) != -1);
2636 if (child == 0) {
2637 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2644 printf("Before raising %s from child\n", strsignal(sigval));
2647 printf("Before exiting of the child process\n");
2650 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2652 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2653 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2658 child, getpid());
2660 lookup_me1 = ptrace(PT_READ_D, child, &lookup_me1, 0);
2667 child, getpid());
2669 lookup_me2 = ptrace(PT_READ_D, child, &lookup_me2, 0);
2676 child, getpid());
2678 lookup_me3 = ptrace(PT_READ_D, child, &lookup_me3, 0);
2684 printf("Before resuming the child process where it left off and "
2686 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2688 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2689 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2693 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2694 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2708 pid_t child, wpid;
2722 ATF_REQUIRE((child = fork()) != -1);
2723 if (child == 0) {
2724 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2732 printf("Before raising %s from child\n", strsignal(sigval));
2735 printf("Before exiting of the child process\n");
2738 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2740 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2741 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2746 child, getpid());
2748 lookup_me1 = ptrace(PT_READ_D, child, &lookup_me1, 0);
2755 child, getpid());
2757 lookup_me2 = ptrace(PT_READ_D, child, &lookup_me2, 0);
2764 child, getpid());
2766 lookup_me3 = ptrace(PT_READ_D, child, &lookup_me3, 0);
2773 child, getpid());
2775 lookup_me4 = ptrace(PT_READ_D, child, &lookup_me4, 0);
2781 printf("Before resuming the child process where it left off and "
2783 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2785 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2786 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2790 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2791 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2805 pid_t child, wpid;
2813 ATF_REQUIRE((child = fork()) != -1);
2814 if (child == 0) {
2815 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2818 printf("Before raising %s from child\n", strsignal(sigval));
2823 printf("Before exiting of the child process\n");
2826 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2828 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2829 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2834 child, getpid());
2835 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me, magic) != -1);
2837 printf("Before resuming the child process where it left off and "
2839 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2841 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2842 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2846 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2847 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2861 pid_t child, wpid;
2871 ATF_REQUIRE((child = fork()) != -1);
2872 if (child == 0) {
2873 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2876 printf("Before raising %s from child\n", strsignal(sigval));
2882 printf("Before exiting of the child process\n");
2885 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2887 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2888 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2893 child, getpid());
2894 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me1, magic1) != -1);
2897 child, getpid());
2898 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me2, magic2) != -1);
2900 printf("Before resuming the child process where it left off and "
2902 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2904 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2905 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2909 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2910 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2924 pid_t child, wpid;
2936 ATF_REQUIRE((child = fork()) != -1);
2937 if (child == 0) {
2938 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
2941 printf("Before raising %s from child\n", strsignal(sigval));
2948 printf("Before exiting of the child process\n");
2951 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
2953 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2954 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2959 child, getpid());
2960 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me1, magic1) != -1);
2963 child, getpid());
2964 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me2, magic2) != -1);
2967 child, getpid());
2968 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me3, magic3) != -1);
2970 printf("Before resuming the child process where it left off and "
2972 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
2974 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2975 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
2979 printf("Before calling %s() for the child\n", TWAIT_FNAME);
2980 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
2994 pid_t child, wpid;
3008 ATF_REQUIRE((child = fork()) != -1);
3009 if (child == 0) {
3010 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3013 printf("Before raising %s from child\n", strsignal(sigval));
3021 printf("Before exiting of the child process\n");
3024 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3026 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3027 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3032 child, getpid());
3033 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me1, magic1) != -1);
3036 child, getpid());
3037 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me2, magic2) != -1);
3040 child, getpid());
3041 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me3, magic3) != -1);
3044 child, getpid());
3045 ATF_REQUIRE(ptrace(PT_WRITE_D, child, &lookup_me4, magic4) != -1);
3047 printf("Before resuming the child process where it left off and "
3049 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3051 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3052 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3056 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3057 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3071 pid_t child, wpid;
3093 ATF_REQUIRE((child = fork()) != -1);
3094 if (child == 0) {
3095 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3100 printf("Before raising %s from child\n", strsignal(sigval));
3105 printf("Before exiting of the child process\n");
3108 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3110 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3111 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3116 child, getpid());
3117 ATF_REQUIRE(ptrace(PT_IO, child, &io_fromtracee, 0) != -1);
3126 child, getpid());
3127 ATF_REQUIRE(ptrace(PT_IO, child, &io_totracee, 0) != -1);
3133 printf("Before resuming the child process where it left off and "
3135 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3137 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3138 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3142 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3143 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3157 pid_t child, wpid;
3179 ATF_REQUIRE((child = fork()) != -1);
3180 if (child == 0) {
3181 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3186 printf("Before raising %s from child\n", strsignal(sigval));
3191 printf("Before exiting of the child process\n");
3194 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3196 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3197 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3204 child, getpid());
3205 ATF_REQUIRE(ptrace(PT_IO, child, &io_totracee, 0) != -1);
3212 child, getpid());
3213 ATF_REQUIRE(ptrace(PT_IO, child, &io_fromtracee, 0) != -1);
3219 printf("Before resuming the child process where it left off and "
3221 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3223 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3224 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3228 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3229 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3243 pid_t child, wpid;
3253 ATF_REQUIRE((child = fork()) != -1);
3254 if (child == 0) {
3255 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3260 printf("Before raising %s from child\n", strsignal(sigval));
3265 printf("Before exiting of the child process\n");
3268 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3270 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3271 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3276 child, getpid());
3279 ptrace(PT_READ_D, child, &lookup_me_fromtracee, 0);
3287 child, getpid());
3289 (ptrace(PT_WRITE_D, child, &lookup_me_totracee, magic_totracee)
3292 printf("Before resuming the child process where it left off and "
3294 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3296 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3297 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3301 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3302 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3316 pid_t child, wpid;
3326 ATF_REQUIRE((child = fork()) != -1);
3327 if (child == 0) {
3328 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3333 printf("Before raising %s from child\n", strsignal(sigval));
3338 printf("Before exiting of the child process\n");
3341 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3343 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3344 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3349 child, getpid());
3351 (ptrace(PT_WRITE_D, child, &lookup_me_totracee, magic_totracee)
3355 child, getpid());
3358 ptrace(PT_READ_D, child, &lookup_me_fromtracee, 0);
3365 printf("Before resuming the child process where it left off and "
3367 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3369 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3370 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3374 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3375 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3438 pid_t child, wpid;
3453 ATF_REQUIRE((child = fork()) != -1);
3454 if (child == 0) {
3455 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3458 printf("Before raising %s from child\n", strsignal(sigval));
3461 printf("Before exiting of the child process\n");
3464 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3466 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3467 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3472 child, getpid());
3473 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
3478 printf("Before resuming the child process where it left off and "
3480 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3482 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3483 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3487 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3488 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3502 pid_t child, wpid;
3517 ATF_REQUIRE((child = fork()) != -1);
3518 if (child == 0) {
3519 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3522 printf("Before raising %s from child\n", strsignal(sigval));
3525 printf("Before exiting of the child process\n");
3528 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3530 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3531 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3536 child, getpid());
3537 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
3542 printf("Before resuming the child process where it left off and "
3544 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3546 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3547 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3551 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3552 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3566 pid_t child, wpid;
3581 ATF_REQUIRE((child = fork()) != -1);
3582 if (child == 0) {
3583 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3586 printf("Before raising %s from child\n", strsignal(sigval));
3589 printf("Before exiting of the child process\n");
3592 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3594 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3595 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3600 child, getpid());
3601 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
3606 printf("Before resuming the child process where it left off and "
3608 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3610 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3611 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3615 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3616 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3630 pid_t child, wpid;
3645 ATF_REQUIRE((child = fork()) != -1);
3646 if (child == 0) {
3647 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3650 printf("Before raising %s from child\n", strsignal(sigval));
3653 printf("Before exiting of the child process\n");
3656 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3658 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3659 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3664 child, getpid());
3665 ATF_REQUIRE(ptrace(PT_IO, child, &io, 0) != -1);
3670 printf("Before resuming the child process where it left off and "
3672 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3674 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3675 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3679 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3680 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3694 pid_t child, wpid;
3703 ATF_REQUIRE((child = fork()) != -1);
3704 if (child == 0) {
3705 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3708 printf("Before raising %s from child\n", strsignal(sigval));
3711 printf("Before exiting of the child process\n");
3714 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3716 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3717 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3722 child, getpid());
3724 lookup_me = ptrace(PT_READ_I, child, dummy_fn1, 0);
3730 printf("Before resuming the child process where it left off and "
3732 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3734 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3735 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3739 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3740 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3754 pid_t child, wpid;
3766 ATF_REQUIRE((child = fork()) != -1);
3767 if (child == 0) {
3768 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3771 printf("Before raising %s from child\n", strsignal(sigval));
3774 printf("Before exiting of the child process\n");
3777 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3779 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3780 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3785 child, getpid());
3787 lookup_me1 = ptrace(PT_READ_I, child, dummy_fn1, 0);
3794 child, getpid());
3796 lookup_me2 = ptrace(PT_READ_I, child, dummy_fn2, 0);
3802 printf("Before resuming the child process where it left off and "
3804 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3806 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3807 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3811 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3812 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3826 pid_t child, wpid;
3841 ATF_REQUIRE((child = fork()) != -1);
3842 if (child == 0) {
3843 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3846 printf("Before raising %s from child\n", strsignal(sigval));
3849 printf("Before exiting of the child process\n");
3852 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3854 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3855 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3860 child, getpid());
3862 lookup_me1 = ptrace(PT_READ_I, child, dummy_fn1, 0);
3869 child, getpid());
3871 lookup_me2 = ptrace(PT_READ_I, child, dummy_fn2, 0);
3878 child, getpid());
3880 lookup_me3 = ptrace(PT_READ_I, child, dummy_fn3, 0);
3886 printf("Before resuming the child process where it left off and "
3888 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3890 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3891 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3895 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3896 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
3910 pid_t child, wpid;
3928 ATF_REQUIRE((child = fork()) != -1);
3929 if (child == 0) {
3930 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
3933 printf("Before raising %s from child\n", strsignal(sigval));
3936 printf("Before exiting of the child process\n");
3939 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
3941 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3942 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3947 child, getpid());
3949 lookup_me1 = ptrace(PT_READ_I, child, dummy_fn1, 0);
3956 child, getpid());
3958 lookup_me2 = ptrace(PT_READ_I, child, dummy_fn2, 0);
3965 child, getpid());
3967 lookup_me3 = ptrace(PT_READ_I, child, dummy_fn3, 0);
3974 child, getpid());
3976 lookup_me4 = ptrace(PT_READ_I, child, dummy_fn4, 0);
3982 printf("Before resuming the child process where it left off and "
3984 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
3986 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3987 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
3991 printf("Before calling %s() for the child\n", TWAIT_FNAME);
3992 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4007 pid_t child, wpid;
4014 ATF_REQUIRE((child = fork()) != -1);
4015 if (child == 0) {
4016 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4019 printf("Before raising %s from child\n", strsignal(sigval));
4022 printf("Before exiting of the child process\n");
4025 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4027 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4028 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4032 printf("Call GETREGS for the child process\n");
4033 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
4035 printf("Before resuming the child process where it left off and "
4037 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4039 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4040 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4044 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4045 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4061 pid_t child, wpid;
4068 ATF_REQUIRE((child = fork()) != -1);
4069 if (child == 0) {
4070 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4073 printf("Before raising %s from child\n", strsignal(sigval));
4076 printf("Before exiting of the child process\n");
4079 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4081 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4082 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4086 printf("Call GETREGS for the child process\n");
4087 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
4091 printf("Before resuming the child process where it left off and "
4093 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4095 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4096 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4100 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4101 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4117 pid_t child, wpid;
4124 ATF_REQUIRE((child = fork()) != -1);
4125 if (child == 0) {
4126 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4129 printf("Before raising %s from child\n", strsignal(sigval));
4132 printf("Before exiting of the child process\n");
4135 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4137 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4138 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4142 printf("Call GETREGS for the child process\n");
4143 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
4147 printf("Before resuming the child process where it left off and "
4149 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4151 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4152 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4156 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4157 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4173 pid_t child, wpid;
4180 ATF_REQUIRE((child = fork()) != -1);
4181 if (child == 0) {
4182 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4185 printf("Before raising %s from child\n", strsignal(sigval));
4188 printf("Before exiting of the child process\n");
4191 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4193 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4194 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4198 printf("Call GETREGS for the child process\n");
4199 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
4203 printf("Before resuming the child process where it left off and "
4205 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4207 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4208 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4212 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4213 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4229 pid_t child, wpid;
4236 ATF_REQUIRE((child = fork()) != -1);
4237 if (child == 0) {
4238 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4241 printf("Before raising %s from child\n", strsignal(sigval));
4244 printf("Before exiting of the child process\n");
4247 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4249 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4250 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4254 printf("Call GETREGS for the child process\n");
4255 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
4257 printf("Call SETREGS for the child process (without changed regs)\n");
4258 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
4260 printf("Before resuming the child process where it left off and "
4262 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4264 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4265 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4269 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4270 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4286 pid_t child, wpid;
4293 ATF_REQUIRE((child = fork()) != -1);
4294 if (child == 0) {
4295 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4298 printf("Before raising %s from child\n", strsignal(sigval));
4301 printf("Before exiting of the child process\n");
4304 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4306 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4307 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4311 printf("Call GETFPREGS for the child process\n");
4312 ATF_REQUIRE(ptrace(PT_GETFPREGS, child, &r, 0) != -1);
4314 printf("Before resuming the child process where it left off and "
4316 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4318 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4319 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4323 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4324 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4341 pid_t child, wpid;
4348 ATF_REQUIRE((child = fork()) != -1);
4349 if (child == 0) {
4350 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4353 printf("Before raising %s from child\n", strsignal(sigval));
4356 printf("Before exiting of the child process\n");
4359 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4361 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4362 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4366 printf("Call GETFPREGS for the child process\n");
4367 ATF_REQUIRE(ptrace(PT_GETFPREGS, child, &r, 0) != -1);
4369 printf("Call SETFPREGS for the child (without changed regs)\n");
4370 ATF_REQUIRE(ptrace(PT_SETFPREGS, child, &r, 0) != -1);
4372 printf("Before resuming the child process where it left off and "
4374 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4376 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4377 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4381 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4382 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4398 pid_t child, wpid;
4405 ATF_REQUIRE((child = fork()) != -1);
4406 if (child == 0) {
4407 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4412 printf("Before raising %s from child\n", strsignal(sigval));
4417 printf("Before exiting of the child process\n");
4420 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4422 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4423 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4427 printf("Before resuming the child process where it left off and "
4429 ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
4431 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4432 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4436 printf("Before resuming the child process where it left off and "
4438 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4440 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4441 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4445 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4446 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4462 pid_t child, wpid;
4470 ATF_REQUIRE((child = fork()) != -1);
4471 if (child == 0) {
4472 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4477 printf("Before raising %s from child\n", strsignal(sigval));
4482 printf("Before exiting of the child process\n");
4485 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4487 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4488 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4493 printf("Before resuming the child process where it left off "
4495 ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
4497 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4498 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0),
4499 child);
4504 printf("Before resuming the child process where it left off and "
4506 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4508 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4509 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4513 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4514 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4530 pid_t child, wpid;
4538 ATF_REQUIRE((child = fork()) != -1);
4539 if (child == 0) {
4540 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4545 printf("Before raising %s from child\n", strsignal(sigval));
4550 printf("Before exiting of the child process\n");
4553 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4555 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4556 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4561 printf("Before resuming the child process where it left off "
4563 ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
4565 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4566 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0),
4567 child);
4572 printf("Before resuming the child process where it left off and "
4574 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4576 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4577 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4581 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4582 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4598 pid_t child, wpid;
4606 ATF_REQUIRE((child = fork()) != -1);
4607 if (child == 0) {
4608 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4613 printf("Before raising %s from child\n", strsignal(sigval));
4618 printf("Before exiting of the child process\n");
4621 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4623 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4624 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4629 printf("Before resuming the child process where it left off "
4631 ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
4633 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4634 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0),
4635 child);
4640 printf("Before resuming the child process where it left off and "
4642 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4644 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4645 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4649 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4650 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4658 "Verify that PT_CONTINUE with SIGKILL terminates child");
4664 pid_t child, wpid;
4670 ATF_REQUIRE((child = fork()) != -1);
4671 if (child == 0) {
4672 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4675 printf("Before raising %s from child\n", strsignal(sigval));
4682 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4684 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4685 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4689 printf("Before resuming the child process where it left off and "
4691 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigsent) != -1);
4693 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4694 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4698 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4699 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4706 "Verify that PT_KILL terminates child");
4712 pid_t child, wpid;
4718 ATF_REQUIRE((child = fork()) != -1);
4719 if (child == 0) {
4720 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4723 printf("Before raising %s from child\n", strsignal(sigval));
4730 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4732 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4733 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4737 printf("Before resuming the child process where it left off and "
4739 ATF_REQUIRE(ptrace(PT_KILL, child, (void*)1, 0) != -1);
4741 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4742 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4746 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4747 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4761 pid_t child, wpid;
4768 ATF_REQUIRE((child = fork()) != -1);
4769 if (child == 0) {
4770 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4773 printf("Before raising %s from child\n", strsignal(sigval));
4776 printf("Before exiting of the child process\n");
4779 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4781 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4782 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4786 printf("Before calling ptrace(2) with PT_LWPINFO for child\n");
4787 ATF_REQUIRE(ptrace(PT_LWPINFO, child, &info, sizeof(info)) != -1);
4798 printf("Before calling ptrace(2) with PT_LWPINFO for child\n");
4799 ATF_REQUIRE(ptrace(PT_LWPINFO, child, &info, sizeof(info)) != -1);
4801 printf("Assert that there are no more lwp threads in child\n");
4804 printf("Before resuming the child process where it left off and "
4806 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4808 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4809 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4813 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4814 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
4855 /* No IPC to communicate with the child */
4865 printf("Before calling ptrace(2) with PT_LWPINFO for child\n");
4876 printf("Before calling ptrace(2) with PT_LWPINFO for child\n");
4880 printf("Assert that there are no more lwp threads in child\n");
4948 pid_t child, wpid;
4956 ATF_REQUIRE((child = fork()) != -1);
4957 if (child == 0) {
4958 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
4961 printf("Before raising %s from child\n", strsignal(sigval));
4964 printf("Before exiting of the child process\n");
4967 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
4969 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4970 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4974 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
4975 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
4982 printf("Before resuming the child process where it left off and "
4984 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
4986 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4987 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
4991 printf("Before calling %s() for the child\n", TWAIT_FNAME);
4992 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5017 pid_t child, wpid;
5026 ATF_REQUIRE((child = fork()) != -1);
5027 if (child == 0) {
5028 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5037 printf("Before raising %s from child\n", strsignal(sigval));
5042 printf("Before exiting of the child process\n");
5045 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5047 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5048 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5052 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5053 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5060 printf("Before calling ptrace(2) with PT_SET_SIGINFO for child\n");
5061 ATF_REQUIRE(ptrace(PT_SET_SIGINFO, child, &info, sizeof(info)) != -1);
5063 printf("Before resuming the child process where it left off and "
5065 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigval) != -1);
5067 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5068 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5072 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5073 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5103 pid_t child, wpid;
5112 ATF_REQUIRE((child = fork()) != -1);
5113 if (child == 0) {
5114 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5123 printf("Before raising %s from child\n", strsignal(sigval));
5128 printf("Before exiting of the child process\n");
5131 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5133 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5134 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5138 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5139 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5151 printf("Before calling ptrace(2) with PT_SET_SIGINFO for child\n");
5152 ATF_REQUIRE(ptrace(PT_SET_SIGINFO, child, &info, sizeof(info)) != -1);
5154 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5155 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5161 printf("Before resuming the child process where it left off and "
5163 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigfaked) != -1);
5165 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5166 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5170 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5171 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5184 pid_t child, wpid;
5193 ATF_REQUIRE((child = fork()) != -1);
5194 if (child == 0) {
5195 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5198 printf("Before calling execve(2) from child\n");
5203 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5205 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5206 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5210 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5211 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5221 printf("Before resuming the child process where it left off and "
5223 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5225 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5226 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5228 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5229 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5246 pid_t child, child2, wpid;
5259 ATF_REQUIRE((child = fork()) != -1);
5260 if (child == 0) {
5261 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5264 printf("Before raising %s from child\n", strsignal(sigval));
5277 printf("Before exiting of the child process\n");
5280 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5282 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5283 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5287 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5288 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5294 printf("Enable PTRACE_FORK in EVENT_MASK for the child %d\n", child);
5296 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
5298 printf("Before resuming the child process where it left off and "
5300 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5302 printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
5303 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5307 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5308 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5314 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
5320 printf("Before calling %s() for the forkee %d of the child %d\n",
5321 TWAIT_FNAME, child2, child);
5327 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5328 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5336 ATF_REQUIRE_EQ(state.pe_other_pid, child);
5342 printf("Before resuming the child process where it left off and "
5344 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5358 printf("Before calling %s() for the child - expected stopped "
5360 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5364 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5365 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5371 printf("Before resuming the child process where it left off and "
5373 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5375 printf("Before calling %s() for the child - expected exited\n",
5377 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5381 printf("Before calling %s() for the child - expected no process\n",
5383 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5399 pid_t child, wpid;
5409 ATF_REQUIRE((child = fork()) != -1);
5410 if (child == 0) {
5411 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5416 printf("Before raising %s from child\n", strsignal(sigval));
5421 printf("Before exiting of the child process\n");
5424 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5426 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5427 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5431 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5432 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5438 printf("Before resuming the child process where it left off and "
5440 ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
5442 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5443 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5447 printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
5448 ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
5454 printf("Before resuming the child process where it left off and "
5456 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5458 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5459 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5463 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5464 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5489 pid_t child, wpid;
5503 ATF_REQUIRE((child = fork()) != -1);
5504 if (child == 0) {
5505 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5508 printf("Before raising %s from child\n", strsignal(sigval));
5511 printf("Before allocating memory for stack in child\n");
5514 printf("Before making context for new lwp in child\n");
5517 printf("Before creating new in child\n");
5527 printf("Before exiting of the child process\n");
5530 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5532 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5533 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5537 printf("Set empty EVENT_MASK for the child %d\n", child);
5539 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
5541 printf("Before resuming the child process where it left off and "
5543 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5545 printf("Before calling %s() for the child - expected stopped "
5547 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5551 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
5558 printf("Before resuming the child process where it left off and "
5560 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5562 printf("Before calling %s() for the child - expected exited\n",
5564 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5568 printf("Before calling %s() for the child - expected no process\n",
5570 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5585 pid_t child, wpid;
5599 ATF_REQUIRE((child = fork()) != -1);
5600 if (child == 0) {
5601 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5604 printf("Before raising %s from child\n", strsignal(sigval));
5607 printf("Before allocating memory for stack in child\n");
5610 printf("Before making context for new lwp in child\n");
5613 printf("Before creating new in child\n");
5623 printf("Before exiting of the child process\n");
5626 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5628 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5629 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5633 printf("Set empty EVENT_MASK for the child %d\n", child);
5635 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
5637 printf("Before resuming the child process where it left off and "
5639 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5641 printf("Before calling %s() for the child - expected stopped "
5643 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5647 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
5654 printf("Before resuming the child process where it left off and "
5656 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5658 printf("Before calling %s() for the child - expected exited\n",
5660 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5664 printf("Before calling %s() for the child - expected no process\n",
5666 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5683 pid_t child, wpid;
5690 ATF_REQUIRE((child = fork()) != -1);
5691 if (child == 0) {
5692 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5699 printf("Before raising %s from child\n", strsignal(sigval));
5702 printf("Before raising %s from child\n",
5706 printf("Before exiting of the child process\n");
5709 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5711 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5712 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5716 printf("Before resuming the child process where it left off and "
5718 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5720 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5721 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5725 printf("Before resuming the child process where it left off and "
5727 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5729 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5730 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5734 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5735 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5751 pid_t child, wpid;
5758 ATF_REQUIRE((child = fork()) != -1);
5759 if (child == 0) {
5760 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5767 printf("Before raising %s from child\n", strsignal(sigval));
5770 printf("Before raising %s breakpoint from child\n",
5774 printf("Before exiting of the child process\n");
5777 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5779 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5780 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5784 printf("Before resuming the child process where it left off and "
5786 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5788 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5789 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5793 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5794 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5810 pid_t child, wpid;
5819 ATF_REQUIRE((child = fork()) != -1);
5820 if (child == 0) {
5821 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5828 printf("Before raising %s from child\n", strsignal(sigval));
5831 printf("Before raising software breakpoint from child\n");
5838 printf("Before exiting of the child process\n");
5841 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5843 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5844 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5848 printf("Before resuming the child process where it left off and "
5850 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5852 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5853 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5857 printf("Before resuming the child process where it left off and "
5859 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5861 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5862 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5866 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5867 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5884 pid_t child, wpid;
5894 ATF_REQUIRE((child = fork()) != -1);
5895 if (child == 0) {
5896 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5905 printf("Before raising %s from child\n", strsignal(sigval));
5910 printf("Before exiting of the child process\n");
5913 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5915 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5916 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5920 printf("Before resuming the child process where it left off and "
5922 ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
5924 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5925 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5929 printf("Before resuming the child process where it left off and "
5931 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5933 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5934 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5938 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5939 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
5956 pid_t child, wpid;
5965 ATF_REQUIRE((child = fork()) != -1);
5966 if (child == 0) {
5967 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
5974 printf("Before raising %s from child\n", strsignal(sigval));
5977 printf("Before calling execve(2) from child\n");
5980 printf("Before exiting of the child process\n");
5983 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
5985 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5986 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5990 printf("Before resuming the child process where it left off and "
5992 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
5994 printf("Before calling %s() for the child\n", TWAIT_FNAME);
5995 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
5999 printf("Before resuming the child process where it left off and "
6001 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6003 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6004 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6008 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6009 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
6027 pid_t child, child2, wpid;
6040 ATF_REQUIRE((child = fork()) != -1);
6041 if (child == 0) {
6042 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
6049 printf("Before raising %s from child\n", strsignal(sigval));
6062 printf("Before exiting of the child process\n");
6065 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
6067 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6068 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6072 printf("Enable PTRACE_FORK in EVENT_MASK for the child %d\n", child);
6074 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
6076 printf("Before resuming the child process where it left off and "
6078 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6080 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6081 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6085 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
6099 ATF_REQUIRE_EQ(state.pe_other_pid, child);
6105 printf("Before resuming the child process where it left off and "
6107 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6121 printf("Before calling %s() for the child - expected stopped "
6123 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6127 printf("Before resuming the child process where it left off and "
6129 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6131 printf("Before calling %s() for the child - expected exited\n",
6133 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6137 printf("Before calling %s() for the child - expected no process\n",
6139 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
6158 pid_t child, child2, wpid;
6171 ATF_REQUIRE((child = fork()) != -1);
6172 if (child == 0) {
6173 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
6180 printf("Before raising %s from child\n", strsignal(sigval));
6193 printf("Before exiting of the child process\n");
6196 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
6198 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6199 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6203 printf("Enable PTRACE_VFORK in EVENT_MASK for the child %d\n", child);
6205 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
6207 printf("Before resuming the child process where it left off and "
6209 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6211 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6212 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6216 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
6230 ATF_REQUIRE_EQ(state.pe_other_pid, child);
6236 printf("Before resuming the child process where it left off and "
6238 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6252 printf("Before calling %s() for the child - expected stopped "
6254 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6258 printf("Before resuming the child process where it left off and "
6260 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6262 printf("Before calling %s() for the child - expected exited\n",
6264 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6268 printf("Before calling %s() for the child - expected no process\n",
6270 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
6288 pid_t child, child2, wpid;
6301 ATF_REQUIRE((child = fork()) != -1);
6302 if (child == 0) {
6303 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
6310 printf("Before raising %s from child\n", strsignal(sigval));
6323 printf("Before exiting of the child process\n");
6326 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
6328 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6329 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6333 printf("Enable PTRACE_VFORK_DONE in EVENT_MASK for the child %d\n",
6334 child);
6336 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
6338 printf("Before resuming the child process where it left off and "
6340 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6342 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6343 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6347 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
6353 printf("Before resuming the child process where it left off and "
6355 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6357 printf("Before calling %s() for the child - expected stopped "
6359 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6363 printf("Before resuming the child process where it left off and "
6365 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6367 printf("Before calling %s() for the child - expected exited\n",
6369 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6373 printf("Before calling %s() for the child - expected no process\n",
6375 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
6391 pid_t child, wpid;
6408 ATF_REQUIRE((child = fork()) != -1);
6409 if (child == 0) {
6410 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
6417 printf("Before raising %s from child\n", strsignal(sigval));
6420 printf("Before allocating memory for stack in child\n");
6423 printf("Before making context for new lwp in child\n");
6426 printf("Before creating new in child\n");
6436 printf("Before exiting of the child process\n");
6439 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
6441 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6442 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6446 printf("Set empty EVENT_MASK for the child %d\n", child);
6448 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
6450 printf("Before resuming the child process where it left off and "
6452 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6454 printf("Before calling %s() for the child - expected stopped "
6456 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6460 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
6467 printf("Before resuming the child process where it left off and "
6469 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6471 printf("Before calling %s() for the child - expected exited\n",
6473 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6477 printf("Before calling %s() for the child - expected no process\n",
6479 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
6495 pid_t child, wpid;
6512 ATF_REQUIRE((child = fork()) != -1);
6513 if (child == 0) {
6514 printf("Before calling PT_TRACE_ME from child %d\n", getpid());
6521 printf("Before raising %s from child\n", strsignal(sigval));
6524 printf("Before allocating memory for stack in child\n");
6527 printf("Before making context for new lwp in child\n");
6530 printf("Before creating new in child\n");
6540 printf("Before exiting of the child process\n");
6543 printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
6545 printf("Before calling %s() for the child\n", TWAIT_FNAME);
6546 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6550 printf("Set empty EVENT_MASK for the child %d\n", child);
6552 ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
6554 printf("Before resuming the child process where it left off and "
6556 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6558 printf("Before calling %s() for the child - expected stopped "
6560 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6564 ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
6571 printf("Before resuming the child process where it left off and "
6573 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
6575 printf("Before calling %s() for the child - expected exited\n",
6577 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
6581 printf("Before calling %s() for the child - expected no process\n",
6583 TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));