* (as of pre-2.4 era) can report idle time going backwards, perhaps due
* to non-atomic reads and updates. There is no locking for these values.
*/
+#if 0
#ifndef NAN
#define NAN (-0.0)
#endif
old_i=new_i;
}
#undef JT
+#endif
/***********************************************************************/
proc_t *this;
int arrindex, total_time, cpumap, i, n = 0;
int sleeping = 0, stopped = 0, zombie = 0, running = 0;
- double system_ticks, user_ticks, nice_ticks, idle_ticks;
+ double system_ticks, user_ticks, nice_ticks, idle_ticks, junk;
static int prev_count = 0;
int systime, usrtime;
n, sleeping, running, zombie, stopped);
PUTP(top_clrtoeol);
putchar('\n');
- four_cpu_numbers(&user_ticks,&nice_ticks,&system_ticks,&idle_ticks);
+ five_cpu_numbers(&user_ticks,&nice_ticks,&system_ticks,&idle_ticks,&junk);
printf("CPU states:"
" %# 5.1f%% user, %# 5.1f%% system,"
" %# 5.1f%% nice, %# 5.1f%% idle",
/* share some process time, since we skipped opendir("/proc") */
usleep (50*1000);
}
- else if (Do(TTY) || Do(STAT))
+ else if (Do(TTY) /*|| Do(STAT) */)
PT = openproc(flags, va_arg(ap, void*)); /* assume ptr sizes same */
else
PT = openproc(flags);
/* read whole file into a memory buffer, allocating as we go */
while ((n = read(fd, buf, sizeof buf - 1)) > 0) {
- if (n < sizeof buf - 1)
+ if (n < (int)(sizeof buf - 1))
end_of_file = 1;
if (n == 0 && rbuf == 0)
return NULL; /* process died between our open and read */