Now I test for PT_SETOPTIONS being #defined.
Remove trailing whitespace.
No actual code changes.
tprintf("{%p, %p, %ld, %ld}",
event.data, event.obj,
event.res, event.res2);
- else
+ else
#endif
tprintf("{...}");
}
return -1;
}
}
-#ifdef LINUX /* add more OSes after you verified it works for them */
+/* PTRACE_SETOPTIONS is not a #define. PT_SETOPTIONS is. */
+/* Add more OSes after you verified it works for them. */
+#if defined LINUX && defined PT_SETOPTIONS
/*
* Ask kernel to set signo to SIGTRAP | 0x80
* on ptrace-generated SIGTRAPs, and mark
goto tracing;
}
-#ifdef LINUX
+#if defined LINUX && defined PT_SETOPTIONS
if (tcp->sigtrap80 != SIGTRAP && WSTOPSIG(status) == SIGTRAP) {
/*
* We told ptrace to report SIGTRAP | 0x80 on this process
{ -1, TF, sys_aioaread64, "aioaread64" }, /* 417 */
{ -1, TF, sys_aioawrite64, "aioawrite64" }, /* 418 */
{ -1, TF, sys_aiocancel64, "aiocancel64" }, /* 419 */
- { -1, TF, sys_aiofsync, "aiofsync" }, /* 420 */
+ { -1, TF, sys_aiofsync, "aiofsync" }, /* 420 */
#endif
/* Test exit of a child of a TCB_EXITING child where the toplevel process starts
* waiting on it. The middle one gets detached and strace must update the
* toplevel process'es number of attached children to 0.
- *
+ *
* gcc -o test/childthread test/childthread.c -Wall -ggdb2 -pthread;./strace -f ./test/childthread
* It must print: write(1, "OK\n", ...
*/
/* Test handle_group_exit () handling of a thread leader still alive with its
* thread child calling exit_group () and proper passing of the process exit
* code to the process parent of this whole thread group.
- *
+ *
* gcc -o test/leaderkill test/leaderkill.c -Wall -ggdb2 -pthread;./test/leaderkill & pid=$!;sleep 1;strace -o x -q ./strace -f -p $pid
* It must print: write(1, "OK\n", ...
*/