You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 32-bit platforms the date-and-time type from ietf-yang-types cannot handle dates properly after year 2038.
For example when I try to set clock through "/ietf-system:set-current-datetime" RPC to year 2040,
the subscribed rpc callback receives year 1970 in the input values.
I attached an example application to reproduce it: reprod.zip
So I have tested it and reproduced, the cause is timgm() returning -1 (without setting errno for some reason). And based on what I read about this, it seems it is a "feature" of 32b systems so I am not sure what you expect from libyang to make it work.
In case you can recompile everything (and I mean it, everything, since this is obviously a huge ABI change), and you're already on kernel 5.1+ and glibc 2.34+, then you can set -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 and you're good to go. Beware, though, that you might face some nasty surprises if you have, say, a time_t in some binary on-disk file. If you're using a system such as Buildroot, there's a config option for this already, BR2_TIME_BITS_64.
TL;DR: this fix IMHO belongs to the "system library", not into libyang.
Hi,
On 32-bit platforms the date-and-time type from ietf-yang-types cannot handle dates properly after year 2038.
For example when I try to set clock through "/ietf-system:set-current-datetime" RPC to year 2040,
the subscribed rpc callback receives year 1970 in the input values.
I attached an example application to reproduce it:
reprod.zip
libyang version: 2.1.159
sysrepo version: 2.2.155
Thank you in advance!
The text was updated successfully, but these errors were encountered: