1 --- procps-3.2.7/ps/output.c.jitter 2007-04-26 13:15:47.000000000 +0200
2 +++ procps-3.2.7/ps/output.c 2007-04-26 13:31:24.000000000 +0200
4 static int wide_signals; /* true if we have room */
6 static unsigned long seconds_since_1970;
7 -static unsigned long time_of_boot;
8 static unsigned long page_shift;
12 // available space: page_size*outbuf_pages-SPACE_AMOUNT
14 seconds_since_1970 = time(NULL);
15 - time_of_boot = seconds_since_1970 - seconds_since_boot;
19 --- procps-3.2.7/ps/common.h.jitter 2005-01-27 04:43:22.000000000 +0100
20 +++ procps-3.2.7/ps/common.h 2007-04-26 12:44:01.000000000 +0200
22 extern int screen_cols;
23 extern int screen_rows;
24 extern unsigned long seconds_since_boot;
25 +extern unsigned long time_of_boot;
26 extern selection_node *selection_list;
27 extern unsigned simple_select;
28 extern sort_node *sort_list;
29 --- procps-3.2.7/ps/global.c.jitter 2005-10-30 01:43:34.000000000 +0200
30 +++ procps-3.2.7/ps/global.c 2007-04-26 13:26:38.000000000 +0200
34 unsigned long seconds_since_boot = -1;
35 +unsigned long time_of_boot = -1;
36 selection_node *selection_list = (selection_node *)0xdeadbeef;
37 unsigned simple_select = 0xffffffff;
38 sort_node *sort_list = (sort_node *)0xdeadbeef; /* ready-to-use sort list */
45 + char *buf[BUFFSIZE];
48 + /* get boot time from /proc/stat */
49 + fd = open("/proc/stat", O_RDONLY, 0);
51 + buf[BUFFSIZE-1] = 0;
52 + read(fd, buf, BUFFSIZE-1);
53 + b = strstr(buf, "btime ");
55 + sscanf(b, "btime %lu", &time_of_boot);
56 + seconds_since_boot = time(0) - time_of_boot;
66 page_size = getpagesize();
68 - seconds_since_boot = uptime(0,0);
69 selection_list = NULL;