procps/ps
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:26:07 +00:00
common.h crazy Debian GNU/kFreeBSD guy wanted this 2005-01-27 04:08:10 +00:00
COPYING procps 010114 2002-02-01 22:47:29 +00:00
display.c ps displays cgroup 2010-12-16 10:23:49 +01:00
global.c dietlibc needs termios.h for struct winsize -- thanks Thomas Ogrisegg 2005-10-30 00:04:21 +00:00
HACKING procps 010114 2002-02-01 22:47:29 +00:00
help.c update help text 2004-07-30 04:49:14 +00:00
it procps 010114 2002-02-01 22:47:29 +00:00
module.mk turn off new SE Linux code for now 2005-10-30 03:44:26 +00:00
output.c Read the system boot time from /proc instead of computing 2010-12-16 10:30:39 +01:00
p avoid truncating long usernames 2004-07-21 00:37:38 +00:00
parser.c new /proc/meminfo fields 2008-03-24 04:41:26 +00:00
ps.1 ps displays cgroup 2010-12-16 10:23:49 +01:00
regression procps 010114 2002-02-01 22:47:29 +00:00
select.c hard disk about to die 2003-09-28 02:45:05 +00:00
sortformat.c new /proc/meminfo fields 2008-03-24 04:41:26 +00:00
stacktrace.c procps 010114 2002-02-01 22:47:29 +00:00
TRANSLATION misc 2004-08-18 02:22:13 +00:00