NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: unable to set time very far in the future
On Sun, 16 Oct 2022 at 15:34, Jan Schaumann <jschauma%netmeister.org@localhost> wrote:
>
> RVP <rvp%SDF.ORG@localhost> wrote:
> > On Sat, 15 Oct 2022, Jan Schaumann wrote:
> >
> > > - I just can't _set_ the clock to any value above
> > > 68719476736. Anybody know why?
> > >
> >
> > There is a check in the kernel. In sys/kern/kern_time.c:
> >
> > 190 /*
> > 191 * The time being set to an unreasonable value will cause
> > 192 * unreasonable system behaviour.
> > 193 */
> > 194 if (ts->tv_sec < 0 || ts->tv_sec > (1LL << 36))
> > 195 return EINVAL;
> >
> > And, `date 414708200732.17' == (1<<36) + 1 secs.
>
> Cool, thanks!
>
> Do we have examples of what this "unreasonable system
> behaviour" might be, and how we ended up picking this
> particular value?
Absent any functional change, could we factor this out to a #define
for future code spelunkers?
Possibly switching to a more human friendly number such as 4000AD (or
4004AD if we port NetBSD to the spindizzy)
David
Home |
Main Index |
Thread Index |
Old Index