[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#41046: Possible fix

Roan Kattouw <roan.kattouw@home.nl> writes:

> Maybe ud should check /proc/uptime to see what the real uptime
> is. That guards against ud being killed/restarted/whatever, but it has
> another flaw: on 32-bit machines /proc/uptime rewinds every 49.7 days
> (on 2.6, 497 days on 2.4).  [...]

ud does check /proc/uptime.  How did you arrive at the 49.7 number?  It
is definitely not the case on this 2.6.8 machine:

  $ cat /proc/uptime
  20859988.28 2609303.78
  $ expr 20859988 / 24 / 60 / 60

As far as I can tell, the number of seconds since boot time is stored in
a 32-bit integer, which should be enough for 68 years.

I don't think the problem here is determining the uptime; it's in making
sure a single boot time doesn't have duplicate records.



Reply to: