home *** CD-ROM | disk | FTP | other *** search
- *** Imakefile.dist Tue Oct 10 08:06:25 1989
- --- Imakefile Wed Feb 21 12:27:04 1990
- ***************
- *** 22,47 ****
- # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- #
-
- #
- # Since xnetload finds the local machine's load using the standard Load
- # widget stuff, it needs to be able to read kmem, i.e. setgid kmem. If
- # you do not want this, then define NOLOCAL
- ! # DEFINES = -O -DNOLOCAL
-
- ! INCLUDES = -I$(TOP) -I$(TOP)/X11
-
- # Dynix doesn't have -L option on load, but I have left changing the
- # XLIB specification up to individual sites. Dynix and our Sun 3.5
- # don't come with a memcpy, so you'll have to add in whichever library
- # has memcpy.
- ! /* LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) */
- ! LOCAL_LIBRARIES = -L/usr/software/X11/lib -lXaw -lXmu -lXt -lX11
-
- ! SRCS = xnetload.c getload.o
- ! OBJS = xnetload.o getload.o
-
- INSTALLFLAGS = $(INSTKMEMFLAGS)
-
- ! all: xnetload
-
- ! SingleProgramTarget(xnetload,$(OBJS),,$(LOCAL_LIBRARIES))
- --- 22,63 ----
- # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- #
-
- + COMPATFLAGS = -DXAW_BC
- +
- #
- # Since xnetload finds the local machine's load using the standard Load
- # widget stuff, it needs to be able to read kmem, i.e. setgid kmem. If
- # you do not want this, then define NOLOCAL
- ! #if SunOSPlatform
- ! RUPDEFINES = -DRUPRPC -DDEFREMUPDATE=5 /* -DDEBUGGING */
- ! SYS_LIBRARIES = -lrpcsvc
- ! #endif
- ! DEFINES = /* -DNOLOCAL */ $(RUPDEFINES)
-
- ! # INCLUDES = -I$(TOP) -I$(TOP)/X11
-
- # Dynix doesn't have -L option on load, but I have left changing the
- # XLIB specification up to individual sites. Dynix and our Sun 3.5
- # don't come with a memcpy, so you'll have to add in whichever library
- # has memcpy.
- ! LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
-
- ! SRCS = xnetload.c getload.c X11/Load.c
- ! OBJS = xnetload.o getload.o Load.o
-
- INSTALLFLAGS = $(INSTKMEMFLAGS)
-
- ! ComplexProgramTarget(xnetload)
-
- ! Load.o: X11/Load.c
- ! $(CC) -c $(CFLAGS) X11/Load.c
- !
- ! #if SunOSPlatform
- ! #if HasGcc /* GCC is too picky about syntax in Sun RPC header files */
- ! getload.o: getload.c
- ! @if [ "$(CC)" != cc ] ;\
- ! then $(MAKE) CC=cc CCOPTIONS= getload.o ;\
- ! else cmd="$(CC) -c $(CFLAGS) getload.c"; echo $$cmd; $$cmd ;\
- ! fi
- ! #endif
- ! #endif
- *** getload.c.dist Tue Oct 10 08:06:26 1989
- --- getload.c Wed Feb 21 13:21:55 1990
- ***************
- *** 32,37 ****
- --- 32,87 ----
- #include <sys/types.h>
- #include <sys/time.h>
-
- + #ifdef RUPRPC
- + #include <sys/param.h>
- + #include <sys/stat.h>
- + #include <sys/socket.h>
- + #include <rpcsvc/rstat.h>
- + #include <rpc/rpc.h>
- + #include <rpc/pmap_clnt.h>
- +
- + int
- + getload(host)
- + char *host;
- + {
- + enum clnt_stat err;
- + struct statstime sw;
- +
- + #ifdef DEBUGGING
- + fprintf(stderr, "xnetload: %s: ", host);
- + fflush(stderr);
- + #endif
- + err = (enum clnt_stat)callrpc(host, RSTATPROG, RSTATVERS_TIME,
- + RSTATPROC_STATS, xdr_void, 0, xdr_statstime, &sw);
- + if (err != RPC_SUCCESS)
- + if (err == RPC_PROGVERSMISMATCH) {
- + if (err = (enum clnt_stat)callrpc(host, RSTATPROG,
- + RSTATVERS_SWTCH, RSTATPROC_STATS, xdr_void, 0,
- + xdr_statsswtch, &sw)) {
- + #ifndef DEBUGGING
- + fprintf(stderr, "xnetload: %s: ", host);
- + #endif
- + clnt_perrno(err);
- + fprintf(stderr, "\n");
- + return( -1 );
- + }
- + }
- + else {
- + #ifndef DEBUGGING
- + fprintf(stderr, "xnetload: %s: ", host);
- + #endif
- + clnt_perrno(err);
- + fprintf(stderr, "\n");
- + return( -1 );
- + }
- +
- + #ifdef DEBUGGING
- + fprintf(stderr, "%lf\n", (double)sw.avenrun[0]/FSCALE);
- + #endif
- + return( (double)sw.avenrun[0]/FSCALE * 100.0);
- + }
- +
- + #else /* no RUPRPC */
- /* Dynix doesn't have an rwhod.h file, so here's the struct for that system */
- #ifdef sequent
- struct outmp {
- ***************
- *** 113,115 ****
- --- 163,166 ----
- }
- return(0); /* couldn't read load if here */
- }
- + #endif
-