--- /dev/fd/63 2006-03-17 19:45:28.381175723 +0100 +++ /home/paolo/man/man2/ptrace-mine.2 2005-10-29 00:53:32.000000000 +0200 @@ -179,6 +179,29 @@ PTRACE_TRACEME. Although perhaps not intended, under Linux a traced child can be detached in this way regardless of which method was used to initiate tracing. (\fIaddr\fP is ignored.) +.TP +PTRACE_SETOPTIONS +Allows setting some options that influence the ptrace behavior. You can +set any amount of them by OR'ing and passing them as the \fIdata\fP parameter. +See the section \fBPtrace Options\fP below. +.SH PTRACE OPTIONS +.TP +PTRACE_O_TRACESYSGOOD +Makes possible the distinction between a SIGTRAP delivery and a syscall stop. +When this option is active, the process will appear to be stopped by receipt +of SIGTRAP|0x80, instead of SIGTRAP. +.TP +PTRACE_O_TRACEFORK +.TP +PTRACE_O_TRACEVFORK +.TP +PTRACE_O_TRACECLONE +.TP +PTRACE_O_TRACEEXEC +.TP +PTRACE_O_TRACEVFORKDONE +.TP +PTRACE_O_TRACEEXIT .SH NOTES Although arguments to .B ptrace @@ -227,11 +250,21 @@ request may be \-1, the caller must check .I errno after such requests to determine whether or not an error occurred. +.SH BUGS +On hosts with 2.6 kernel headers, PTRACE_SETOPTIONS is declared with a different +value than the one for 2.4. This leads to applications compiled with such +headers to fail when run on 2.4 host kernels. +.LP +This can be workarounded by redefining PTRACE_SETOPTIONS to +PTRACE_OLDSETOPTIONS, if that is defined. .SH ERRORS .TP .B EBUSY (i386 only) There was an error with allocating or freeing a debug register. .TP +.B EINVAL +An attempt was done to set a nonexisting option. +.TP .B EFAULT There was an attempt to read from or write to an invalid area in the parent's or child's memory, probably because the area wasn't mapped or accessible.