4d3c19af52
Read the time of system boot from /proc/stat (entry: btime) instead of computing it as the difference between the current time and the uptime. This is the only way to get a consistent result which won't possibly change from one run to the next. The problems with the original code were: * Both the current time and the uptime are rounded down to the second, but the system doesn't boot on an integer second value so they do not tick at the same moment. Thus, the rounding errors can cause a one second difference from one run to the next. * We can't read the uptime and the current time at the exact same moment anyway, so the time difference we compute is bound to be inaccurate. Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=222251 Author: Jean Delvare <jdelvare@suse.de> Reviewed-by: Craig Small <csmall@debian.org> |
||
---|---|---|
.. | ||
.cvsignore | ||
.cvsignore.patch | ||
alloc.c | ||
alloc.h | ||
COPYING | ||
devname.c | ||
devname.h | ||
escape.c | ||
escape.h | ||
ksym.c | ||
library.map | ||
module.mk | ||
procps.h | ||
pwcache.c | ||
pwcache.h | ||
readproc.c | ||
readproc.h | ||
sig.c | ||
sig.h | ||
slab.c | ||
slab.h | ||
sysinfo.c | ||
sysinfo.h | ||
version.c | ||
version.h | ||
wchan.h | ||
whattime.c | ||
whattime.h |