29 |
|
#include <sys/ioctl.h> |
30 |
|
#include <unistd.h> |
31 |
|
#include <stdlib.h> |
32 |
– |
#include <sys/termios.h> |
32 |
|
#include <signal.h> |
33 |
|
#include <errno.h> |
34 |
|
#include <statgrab.h> |
36 |
|
#include <limits.h> |
37 |
|
#include <time.h> |
38 |
|
#include <math.h> |
39 |
+ |
#ifdef AIX |
40 |
+ |
#include <termios.h> |
41 |
+ |
#else |
42 |
+ |
#include <sys/termios.h> |
43 |
+ |
#endif |
44 |
|
|
45 |
|
#ifdef HAVE_NCURSES_H |
46 |
|
#define COLOR_SUPPORT |
63 |
|
#define THRESHOLD_WARN_DISK 75.0 |
64 |
|
#define THRESHOLD_ALERT_DISK 90.0 |
65 |
|
|
66 |
+ |
int sig_winch_flag = 0; |
67 |
+ |
|
68 |
|
typedef struct{ |
69 |
|
sg_cpu_percents *cpu_percents; |
70 |
|
sg_mem_stats *mem_stats; |
538 |
|
} |
539 |
|
|
540 |
|
void sig_winch_handler(int dummy){ |
541 |
< |
clear(); |
536 |
< |
display_headings(); |
537 |
< |
display_data(0); |
541 |
> |
sig_winch_flag = 1; |
542 |
|
signal(SIGWINCH, sig_winch_handler); |
543 |
|
} |
544 |
|
|
649 |
|
} |
650 |
|
#endif |
651 |
|
nonl(); |
652 |
+ |
curs_set(0); |
653 |
|
cbreak(); |
654 |
|
noecho(); |
655 |
|
timeout(delay * 1000); |
680 |
|
get_stats(); |
681 |
|
} |
682 |
|
last_update = now; |
683 |
+ |
|
684 |
+ |
if(sig_winch_flag) { |
685 |
+ |
clear(); |
686 |
+ |
display_headings(); |
687 |
+ |
sig_winch_flag = 0; |
688 |
+ |
} |
689 |
|
|
690 |
|
display_data(colouron); |
691 |
|
} |