fix 4 GB wrap-around in top
This commit is contained in:
parent
28d744ee6a
commit
6dbef339c2
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
||||
procps-3.1.11 --> procps-3.1.12
|
||||
|
||||
top: fixed 4 GB wrap-around
|
||||
ps: comes with tests
|
||||
man page: /var/run/utmp, not /etc/utmp #206583
|
||||
required flags moved out of CFLAGS #205429
|
||||
RPM generation handles /lib64
|
||||
WCHAN skips leading '.'
|
||||
|
3
ps/ps.1
3
ps/ps.1
@ -240,8 +240,7 @@ will be destroyed by init(8) if the parent process exits.
|
||||
PROCESS FLAGS
|
||||
|
||||
FORKNOEXEC 1 forked but didn't exec
|
||||
SUPERPRIV 2 used super-user privileges
|
||||
DUMPCORE 4 dumped core
|
||||
SUPERPRIV 4 used super-user privileges
|
||||
|
||||
|
||||
PROCESS STATE CODES
|
||||
|
10
top.c
10
top.c
@ -71,7 +71,8 @@ static char Rc_name [OURPATHSZ];
|
||||
static RCF_t Rc = DEF_RCFILE;
|
||||
|
||||
/* The run-time acquired page size */
|
||||
static int Page_size;
|
||||
static unsigned Page_size;
|
||||
static unsigned page_to_kb_shift;
|
||||
|
||||
/* SMP, Irix/Solaris mode, Linux 2.5.xx support */
|
||||
static int Cpu_tot,
|
||||
@ -1567,6 +1568,11 @@ static void before (char *me)
|
||||
|
||||
/* get virtual page size -- nearing huge! */
|
||||
Page_size = getpagesize();
|
||||
i = Page_size;
|
||||
while(i>1024){
|
||||
i >>= 1;
|
||||
page_to_kb_shift++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2874,6 +2880,8 @@ static proc_t **summary_show (void)
|
||||
}
|
||||
|
||||
|
||||
#define PAGES_2K(n) (unsigned)( (n) << page_to_kb_shift )
|
||||
|
||||
/*
|
||||
* Display information for a single task row. */
|
||||
static void task_show (const WIN_t *q, const proc_t *p)
|
||||
|
5
top.h
5
top.h
@ -82,11 +82,6 @@
|
||||
/* Yield table size as 'int' */
|
||||
#define MAXTBL(t) (int)(sizeof(t) / sizeof(t[0]))
|
||||
|
||||
/* Convert some proc stuff into vaules we can actually use */
|
||||
#define BYTES_2K(n) (unsigned)( (n) >> 10 )
|
||||
#define PAGES_2B(n) (unsigned)( (n) * Page_size )
|
||||
#define PAGES_2K(n) BYTES_2K(PAGES_2B(n))
|
||||
|
||||
/* Used as return arguments in *some* of the sort callbacks */
|
||||
#define SORT_lt ( Frame_srtflg > 0 ? 1 : -1 )
|
||||
#define SORT_gt ( Frame_srtflg > 0 ? -1 : 1 )
|
||||
|
Loading…
Reference in New Issue
Block a user