From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] date command
Date: Thu, 02 Apr 2020 13:33:01 +0200 [thread overview]
Message-ID: <87369mazrm.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <CAK8P3a1KX2Ln5zw=q0-eYLFz1vYL-UGOAA0N=SUFB3jCV1uDVA@mail.gmail.com> (Arnd Bergmann's message of "Thu, 2 Apr 2020 11:55:37 +0200")
>>>>> "Arnd" == Arnd Bergmann <arnd@arndb.de> writes:
Hi,
>> > Linux ubuntu 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
>>
>> This looks to be a kernel regression, presumably introduced by the year
>> 2038 work.
>>
>> Specifically, it seems to reject settimeofday with a tv_sec value less
>> than 1171500:
>>
>> # strace -e settimeofday date -s '1970-01-14 13:24'
>> settimeofday({tv_sec=1171440, tv_usec=0}, NULL) = -1 EINVAL (Invalid argument)
>> date: can't set date: Invalid argument
>>
>> # strace -e settimeofday date -s '1970-01-14 13:25'
>> settimeofday({tv_sec=1171500, tv_usec=0}, NULL) = 0
>> Wed Jan 14 13:25:00 UTC 1970
>>
>> (here on 5.4.18).
> I think this is a result of commit e1d7ba873555 ("time: Always make sure
> wall_to_monotonic isn't positive") that enforces CLOCK_REALTIME to return a
> number greater than CLOCK_MONOTONIC, meaning you cannot set the current
> time to anything less than the number of seconds since booting the system.
> This has been the case since linux-4.3, and is unrelated to the y2038 work.
Ahh yes, thanks - And sorry for pointing fingers in the wrong
direction. I did see the check, but didn't connect the dots.
--
Bye, Peter Korsgaard
prev parent reply other threads:[~2020-04-02 11:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 14:47 [Buildroot] date command shy
2020-03-23 17:05 ` Peter Seiderer
2020-03-24 0:50 ` shy
2020-04-02 9:18 ` Peter Korsgaard
[not found] ` <CAK8P3a1KX2Ln5zw=q0-eYLFz1vYL-UGOAA0N=SUFB3jCV1uDVA@mail.gmail.com>
2020-04-02 11:33 ` Peter Korsgaard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87369mazrm.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox