This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC v4 07/24] time: Deprecate struct timezone members


* Alistair Francis:

> On Fri, Aug 9, 2019 at 6:20 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>>
>> Alistair Francis wrote:
>> > -    int tz_minuteswest;              /* Minutes west of GMT.  */
>> > -    int tz_dsttime;          /* Nonzero if DST is ever in effect.  */
>> > +    int tz_minuteswest_dep;          /* Minutes west of GMT.  */
>> > +    int tz_dsttime_dep;              /* Nonzero if DST is ever in effect.  */
>> These two members should be declared with __attribute_deprecated__. And once we
>> do that, do we still need to change their names? I don't recall any other
>> instance of such name-changing.
>
> The name changing is coming from a suggestion here [1]. I do find it a
> little aggressive though as I do see some build failures, specifically
> for systemd.

Good point.  systemd does this:

        tz.tz_minuteswest = -minutesdelta;
        tz.tz_dsttime = 0; /* DST_NONE */

        /*
         * If the RTC does not run in UTC but in local time, the very first
         * call to settimeofday() will set the kernel's timezone and will warp the
         * system clock, so that it runs in UTC instead of the local time we
         * have read from the RTC.
         */
        if (settimeofday(tv_null, &tz) < 0)
                return negative_errno();

It seems to me that struct timezone is not actually deprecated on the
kernel side when used with settimeofday.  This would be something which
has to happen before we can change its definition.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]