Reply to post: Re: So basically...

Linux clockpocalypse in 2038 is looming and there's no 'serious plan'

Charles 9

Re: So basically...

Any device that doesn't require an absolute date simply needs to be coded to be aware of a rollover and recalculate time differences accordingly. A pretty simple yet sane way to check is if the new time has the high bit nut the old time doesn't (assuming they're signed, the new time is now negative). Unless the device literally has to consider time intervals of over 34 years, it should be safe to assume this is a rollover case, which you can still solve with an adjusted calculation.

It only gets complicated when a device must know the absolute time for clock or logging purposes AND relies on it being exactly four bytes long for alignment purposes (such as for disk I/O).

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon