procps/proc
Jan Görig 4d3c19af52 Read the system boot time from /proc instead of computing
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>
2010-12-16 10:30:39 +01:00
..
.cvsignore resync due to auto* 2002-09-27 13:20:17 +00:00
.cvsignore.patch procps 010114 2002-02-01 22:47:29 +00:00
alloc.c satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
alloc.h big header clean-up 2002-12-09 07:00:07 +00:00
COPYING procps 010114 2002-02-01 22:47:29 +00:00
devname.c update /dev/tty* info to May 2009 devices.txt 2009-05-03 06:39:33 +00:00
devname.h hard disk about to die 2003-09-28 02:45:05 +00:00
escape.c display problem on 64-bit systems fixed 2005-01-05 21:11:21 +00:00
escape.h crazy Debian GNU/kFreeBSD guy wanted this 2005-01-27 04:08:10 +00:00
ksym.c Linux 2.6.17 tty devices. Lose support for original pty numbering. 2006-07-09 04:41:30 +00:00
library.map Read the system boot time from /proc instead of computing 2010-12-16 10:30:39 +01:00
module.mk fix warnings; put CFLAGS on lib link command 2004-09-23 13:41:33 +00:00
procps.h more MIPS crud 2005-02-28 03:29:57 +00:00
pwcache.c fix pwcache again 2004-08-10 04:47:07 +00:00
pwcache.h better handling of long usernames 2004-07-20 23:31:12 +00:00
readproc.c fix the problem with truncated output lines to 2048 characters 2010-12-16 10:24:44 +01:00
readproc.h ps displays cgroup 2010-12-16 10:23:49 +01:00
sig.c SKIP 2003-03-19 01:15:58 +00:00
sig.h SKIP 2003-03-19 01:15:58 +00:00
slab.c g is criteria 2006-06-24 20:12:29 +00:00
slab.h fix overflow on huge NUMA boxes 2005-01-05 21:46:22 +00:00
sysinfo.c Read the system boot time from /proc instead of computing 2010-12-16 10:30:39 +01:00
sysinfo.h Read the system boot time from /proc instead of computing 2010-12-16 10:30:39 +01:00
version.c watch -t 2003-02-09 07:27:16 +00:00
version.h satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
wchan.h Linux 2.6.17 tty devices. Lose support for original pty numbering. 2006-07-09 04:41:30 +00:00
whattime.c leftovers in the 3.2.4 release 2004-11-04 20:50:59 +00:00
whattime.h big header clean-up 2002-12-09 07:00:07 +00:00