This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 04/12] Use clock_settime to implement stime.
On 8/21/19 11:10 AM, Adhemerval Zanella wrote:
>
>
> On 20/08/2019 10:21, Zack Weinberg wrote:
>> Unconditionally, on all ports, use clock_settime to implement stime,
>> not settimeofday or a direct syscall.
>>
>> Note that the former stub implementation of stime would return -1 with
>> errno set to EINVAL if passed a null pointer. With this change, it
>> instead unconditionally dereferences the pointer, so any hypothetical
>> callers that passed NULL will now segfault. I don’t think this will break
>> any non-contrived programs.
>
> I agree that using a null point does not make sense, so I would also recommend
> to use __nonnull ((1)) on function prototype as well.
Good point, but I'm not going to make this change because instead I'm
going to add a patch to the series that demotes stime to a compatibility
symbol, so its public prototype will be removed.
zw