On 28.08.2016 3:38, Andrey Chernov wrote: > On 28.08.2016 2:03, Konstantin Belousov wrote: >> Since ptrace(2) syscall can return -1 for non-error situations, libc >> wrappers set errno to 0 before performing the syscall, as the service >> to the caller. > > Both C99 and POSIX directly prohibits any standard function to set errno > to 0. ptrace() should either choose other errno to indicate non-error > situation or change return -1 to something else. > ...and don't touch errno.
POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." > On both i386 and amd64, the errno symbol was directly > referenced, which only works correctly in single-threaded process. POSIX: "For each thread of a process, the value of errno shall not be affected by function calls or assignments to errno by other threads." _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"