* Jann Horn: > ptrace() with requests PTRACE_PEEKTEXT, PTRACE_PEEKDATA and > PTRACE_PEEKUSER can set errno to zero. AFAICS this is for a good reason (so > that you can tell the difference between a successful PEEK with a result of > -1 and a failed PEEK, even if you forget to clear errno yourself), but it > technically violates the rules described in the errno.3 manpage. > > glibc snippet from sysdeps/unix/sysv/linux/ptrace.c: > > res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data); > if (res >= 0 && request > 0 && request < 4) > { > __set_errno (0); > return ret; > } glibc has various special cases like this for interfaces where the return value is ambiguous, such as NULL from NSS functions: <https://sourceware.org/bugzilla/show_bug.cgi?id=3195#c1> I'm a bit reluctant to fix this due to the backwards compatibility impact. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html