Closed sairon closed 7 years ago
Is there a good or fundamental reason that PTRACE_TRACEME
will be defined iff __ptrace_request
exists, or does that just "happen to work" today?
I can't guarantee that PTRACE_TRACEME
will cease to exist once the __ptrace_request
gets its way to musl but it is true at least in the proposed patch in musl's mailing list: http://www.openwall.com/lists/musl/2015/09/17/1
It is also undefined in uClibc and glibc, so this heuristics seems right. Or do you have another suggestion how to decide which signature should be used?
Yeah, OK, this makes sense to me – if it's defined, it's probably not an enumeration, and vice versa.
Thanks for the patch!
The compilation on musl fails because __ptracerequest enum does not exist. All the PTRACE* constants from ptrace.h are simple defined integers. int is used instead of enum when PTRACE_TRACEME is defined in preprocessing.