home *** CD-ROM | disk | FTP | other *** search
- *** main.c.orig Mon Jun 11 15:32:58 1990
- --- main.c Thu Jun 14 11:41:35 1990
- ***************
- *** 47,52 ****
- --- 47,55 ----
- int argc;
- char **argv;
- {
- + # ifdef sun
- + long lccpu;
- + # endif
-
- argc--, argv++;
- while (argc > 0) {
- ***************
- *** 90,95 ****
- --- 93,106 ----
- perror(swapf);
- exit(1);
- }
- + # ifdef sun
- + kvm = kvm_open( NULL, NULL, NULL, O_RDONLY, "systat" );
- + if (kvm == NULL) {
- + perror("kvm");
- + exit(1);
- + }
- + # endif
- +
- signal(SIGINT, die);
- signal(SIGQUIT, die);
- signal(SIGTERM, die);
- ***************
- *** 115,121 ****
- --- 126,137 ----
-
- gethostname(hostname, sizeof (hostname));
- lseek(kmem, nlst[X_CCPU].n_value, L_SET);
- + #ifdef sun
- + read(kmem, &lccpu, sizeof (ccpu));
- + ccpu = (double) lccpu;
- + #else
- read(kmem, &ccpu, sizeof (ccpu));
- + #endif
- lccpu = log(ccpu);
- hz = getw(nlst[X_HZ].n_value);
- phz = getw(nlst[X_PHZ].n_value);
- ***************
- *** 164,171 ****
- read(kmem, avenrun, sizeof (avenrun));
- (*curcmd->c_fetch)();
- if (curcmd->c_flags & CF_LOADAV) {
- ! j = 5.0*avenrun[0] + 0.5;
- ! dellave -= avenrun[0];
- if (dellave >= 0.0)
- c = '<';
- else {
- --- 180,187 ----
- read(kmem, avenrun, sizeof (avenrun));
- (*curcmd->c_fetch)();
- if (curcmd->c_flags & CF_LOADAV) {
- ! j = 5.0*FSC(avenrun[0]) + 0.5;
- ! dellave -= FSC(avenrun[0]);
- if (dellave >= 0.0)
- c = '<';
- else {
- ***************
- *** 174,185 ****
- }
- if (dellave < 0.1)
- c = '|';
- ! dellave = avenrun[0];
- wmove(wload, 0, 0); wclrtoeol(wload);
- for (i = (j > 50) ? 50 : j; i > 0; i--)
- waddch(wload, c);
- if (j > 50)
- ! wprintw(wload, " %4.1f", avenrun[0]);
- }
- (*curcmd->c_refresh)();
- if (curcmd->c_flags & CF_LOADAV)
- --- 190,201 ----
- }
- if (dellave < 0.1)
- c = '|';
- ! dellave = FSC(avenrun[0]);
- wmove(wload, 0, 0); wclrtoeol(wload);
- for (i = (j > 50) ? 50 : j; i > 0; i--)
- waddch(wload, c);
- if (j > 50)
- ! wprintw(wload, " %4.1f", FSC(avenrun[0]));
- }
- (*curcmd->c_refresh)();
- if (curcmd->c_flags & CF_LOADAV)
- ***************
- *** 192,203 ****
-
- load()
- {
- double avenrun[3];
- !
- lseek(kmem, nlst[X_AVENRUN].n_value, L_SET);
- read(kmem, avenrun, sizeof (avenrun));
- mvprintw(CMDLINE, 0, "%4.1f %4.1f %4.1f",
- ! avenrun[0], avenrun[1], avenrun[2]);
- clrtoeol();
- }
-
- --- 208,222 ----
-
- load()
- {
- + #ifdef sun
- + long avenrun[3];
- + #else
- double avenrun[3];
- ! #endif
- lseek(kmem, nlst[X_AVENRUN].n_value, L_SET);
- read(kmem, avenrun, sizeof (avenrun));
- mvprintw(CMDLINE, 0, "%4.1f %4.1f %4.1f",
- ! FSC(avenrun[0]), FSC(avenrun[1]), FSC(avenrun[2]));
- clrtoeol();
- }
-
-