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 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.

-RVP



Home | Main Index | Thread Index | Old Index