svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys

Andrey Chernov ache at freebsd.org
Sun Aug 28 01:18:57 UTC 2016


On 28.08.2016 4:04, Andrey Chernov wrote:
> On 28.08.2016 3:56, Konstantin Belousov wrote:
>> On Sun, Aug 28, 2016 at 03:38:10AM +0300, 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.
>>>
>> ptrace(2) is not a standard function.
>>
> 
> C99 statement sounds stricter:
> "The value of errno is zero at program startup, but is never set to zero
> by any library function. 176)"
> And syscall is not different from library function from C99 point of view.
> 

>> And, we cannot break ABI for the syscall.

We can fix already broken (from standards point of view) ABI for the
syscall.



More information about the svn-src-head mailing list