robert@olsen.UUCP (Robert Ward) (11/19/90)
#!/bin/sh # # This is a shar (shell archive) file. # In order to extract the contents of this archive, remove everything # above the "#!/bin/sh" line. Then execute the remaining file with # /bin/sh. The following file(s) will be extracted: # BUG-libkvm # Makefile.4.1 # Makefile.4.2 # Makefile.4.3 # Makefile.4.3+NFS # Makefile.dec3100 # Makefile.sun.2.0 # Makefile.sun.3.0 # Makefile.sun.3.2 # Makefile.sun.4.0 # Makefile.sun.4.0+386i # Makefile.sun.4.1 # Makefile.sun4.3.2 # Makefile.ultrix.2.0 # Makefile.ultrix.3.0 # README # RELEASENOTES # # # This archive was generated on Tue Sep 11 15:55:19 MET DST 1990 # # PATH=/bin:/usr/bin:/usr/ucb ; export PATH if [ -f 'BUG-libkvm' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "BUG-libkvm" exit 2 fi echo x - BUG-libkvm sed -e 's/^X//' > BUG-libkvm << '---END-OF-BUG-libkvm---' XThere is a bug in kvm_getcmd(3) which occurs when the arguments for a command Xcontain an '=', or if an '=' in the environment is removed. In user space, Xcommand arguments are laid out like this: X Xa r g 0 '\0' a r g 1 '\0' ... e n v 1 = e n v '\0' e n v 2 = e n v ... X XThe only way to tell where the arguments end and the environment begins is to Xlook for arguments which contain '=', or environment strings which don't. Most Xprograms used to use the first approach. The libkvm library uses the latter, Xand gets it wrong if it sees a '=' in any strings before the last string Xwhich doesn't have one. The korn shell nulls out some '=' in it's environment, Xand if you have it, it's the most noticable tickler of this bug. But even if Xyou don't, you can tickle it with "vi a=b c". X XHere's the fix. You could probably patch the binary to ignore the X"&& (argd.cnt == 0)" test, which will cause slightly incorrect results, Xbut ones a bit closer to the truth. Just search for "\0=" in the Xlibrary, and look past it a bit. X X*** /tmp/,RCSt1a01687 Wed Sep 28 01:50:36 1988 X--- kvmgetcmd.c Mon Aug 29 23:23:43 1988 X*************** X*** 141,150 **** X if (*cp == '=') X eqseen++; X if (*cp-- == '\0') { X! if (eqseen && (argd.cnt == 0)) { X envd.cnt++; X envd.sp = Uvaddr(cp+2); X eqseen = 0; X } else { X argd.cnt++; X } X--- 141,154 ---- X if (*cp == '=') X eqseen++; X if (*cp-- == '\0') { X! if (eqseen) { X envd.cnt++; X envd.sp = Uvaddr(cp+2); X eqseen = 0; X+ if (argd.cnt != 0) { X+ envd.cnt += argd.cnt; X+ argd.cnt = 0; X+ } X } else { X argd.cnt++; X } ---END-OF-BUG-libkvm--- LEN=`wc -c < BUG-libkvm` if [ $LEN != 1656 ] ; then echo shar: File "BUG-libkvm" was $LEN, should have been 1656 bytes fi if [ -f 'Makefile.4.1' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.4.1" exit 2 fi echo x - Makefile.4.1 sed -e 's/^X//' > Makefile.4.1 << '---END-OF-Makefile.4.1---' X# Makefile for SPS (4.1BSD UNIX Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o X XINCS = sps.h XLIBS = -ltermlib XCFLAGS = -I/usr/src/sys -DCHAOS X Xall: $(PROG) X.c.o: X cc $(CFLAGS) -c -O -R $< Xglobals1.o waitingfor.o: X cc $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X cc -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) /bin/$(PROG) X /etc/chown root /bin/$(PROG) X chmod 4711 /bin/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.4.1--- LEN=`wc -c < Makefile.4.1` if [ $LEN != 882 ] ; then echo shar: File "Makefile.4.1" was $LEN, should have been 882 bytes fi if [ -f 'Makefile.4.2' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.4.2" exit 2 fi echo x - Makefile.4.2 sed -e 's/^X//' > Makefile.4.2 << '---END-OF-Makefile.4.2---' X# Makefile for SPS (Vax 4.2BSD and Ultrix1.2 UNIX Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DBSD42 -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.4.2--- LEN=`wc -c < Makefile.4.2` if [ $LEN != 977 ] ; then echo shar: File "Makefile.4.2" was $LEN, should have been 977 bytes fi if [ -f 'Makefile.4.3' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.4.3" exit 2 fi echo x - Makefile.4.3 sed -e 's/^X//' > Makefile.4.3 << '---END-OF-Makefile.4.3---' X# Makefile for SPS (Vax 4.3BSD Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DBSD42 -DBSD43 -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.4.3--- LEN=`wc -c < Makefile.4.3` if [ $LEN != 966 ] ; then echo shar: File "Makefile.4.3" was $LEN, should have been 966 bytes fi if [ -f 'Makefile.4.3+NFS' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.4.3+NFS" exit 2 fi echo x - Makefile.4.3+NFS sed -e 's/^X//' > Makefile.4.3+NFS << '---END-OF-Makefile.4.3+NFS---' X# Makefile for SPS (Vax 4.3BSD+NFS Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DBSD42 -DBSD43 -DNFS -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.4.3+NFS--- LEN=`wc -c < Makefile.4.3+NFS` if [ $LEN != 976 ] ; then echo shar: File "Makefile.4.3+NFS" was $LEN, should have been 976 bytes fi if [ -f 'Makefile.dec3100' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.dec3100" exit 2 fi echo x - Makefile.dec3100 sed -e 's/^X//' > Makefile.dec3100 << '---END-OF-Makefile.dec3100---' X# Makefile for SPS (Ultrix 2.0 UNIX Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DBSD42 -DULTRIX20 -DULTRIX30 -DVPRINTF -DDEC3100 -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -g -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -g $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.dec3100--- LEN=`wc -c < Makefile.dec3100` if [ $LEN != 1005 ] ; then echo shar: File "Makefile.dec3100" was $LEN, should have been 1005 bytes fi if [ -f 'Makefile.sun.2.0' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun.2.0" exit 2 fi echo x - Makefile.sun.2.0 sed -e 's/^X//' > Makefile.sun.2.0 << '---END-OF-Makefile.sun.2.0---' X# Makefile for SPS (Sun-2, Sun UNIX 4.2 Release 2.x Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DSUN -DBSD42 -DNFS -DNOQUOTA -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun.2.0--- LEN=`wc -c < Makefile.sun.2.0` if [ $LEN != 1009 ] ; then echo shar: File "Makefile.sun.2.0" was $LEN, should have been 1009 bytes fi if [ -f 'Makefile.sun.3.0' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun.3.0" exit 2 fi echo x - Makefile.sun.3.0 sed -e 's/^X//' > Makefile.sun.3.0 << '---END-OF-Makefile.sun.3.0---' X# Makefile for SPS (Sun-2 and Sun-3, Sun UNIX 4.2 Release 3.0 Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DSUN -DBSD42 -DNFS -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun.3.0--- LEN=`wc -c < Makefile.sun.3.0` if [ $LEN != 1009 ] ; then echo shar: File "Makefile.sun.3.0" was $LEN, should have been 1009 bytes fi if [ -f 'Makefile.sun.3.2' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun.3.2" exit 2 fi echo x - Makefile.sun.3.2 sed -e 's/^X//' > Makefile.sun.3.2 << '---END-OF-Makefile.sun.3.2---' X# Makefile for SPS (Sun-2 and Sun-3, Sun UNIX 4.2 Release 3.x Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DSUN -DBSD42 -DNFS -DVPRINTF -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun.3.2--- LEN=`wc -c < Makefile.sun.3.2` if [ $LEN != 1019 ] ; then echo shar: File "Makefile.sun.3.2" was $LEN, should have been 1019 bytes fi if [ -f 'Makefile.sun.4.0' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun.4.0" exit 2 fi echo x - Makefile.sun.4.0 sed -e 's/^X//' > Makefile.sun.4.0 << '---END-OF-Makefile.sun.4.0---' X# Makefile for SPS (Sun-2, Sun-3 and Sun-4, SunOS 4.0 Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o stream.o termwidth.o ttystatus.o \ X vmstat.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DSUN -DBSD42 -DNFS -DVPRINTF -DKVM -DSUNOS40 -Isys XLIBS = -ltermlib -lkvm XDIRINSTALL = /usr/kvm X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o stream.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): sys $(INCS) X Xsys: X -mkdir sys X -ln -s /sys/* sys X -ln -s /sys/sys sys/h X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun.4.0--- LEN=`wc -c < Makefile.sun.4.0` if [ $LEN != 1134 ] ; then echo shar: File "Makefile.sun.4.0" was $LEN, should have been 1134 bytes fi if [ -f 'Makefile.sun.4.0+386i' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun.4.0+386i" exit 2 fi echo x - Makefile.sun.4.0+386i sed -e 's/^X//' > Makefile.sun.4.0+386i << '---END-OF-Makefile.sun.4.0+386i---' X# Makefile for SPS (Sun-2, Sun-3 and Sun-4, SunOS 4.0 Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o stream.o termwidth.o ttystatus.o \ X vmstat.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DSUN -DBSD42 -DNFS -DVPRINTF -DKVM -DSUNOS40 -DSUN386I -Isys XLIBS = -ltermlib -lkvm XDIRINSTALL = /usr/kvm X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o stream.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): sys $(INCS) X Xsys: X -mkdir sys X -ln -s /sys/* sys X -ln -s /sys/sys sys/h X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun.4.0+386i--- LEN=`wc -c < Makefile.sun.4.0+386i` if [ $LEN != 1144 ] ; then echo shar: File "Makefile.sun.4.0+386i" was $LEN, should have been 1144 bytes fi if [ -f 'Makefile.sun.4.1' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun.4.1" exit 2 fi echo x - Makefile.sun.4.1 sed -e 's/^X//' > Makefile.sun.4.1 << '---END-OF-Makefile.sun.4.1---' X# Makefile for SPS (Sun-2, Sun-3 and Sun-4, SunOS 4.1 Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o stream.o termwidth.o ttystatus.o \ X waitingfor.o XINCS = sps.h XCC = cc X# You'll need both "-DSUNOS40" and "-DSUNOS41" for SunOS 4.1 XCFLAGS = -DSUN -DBSD42 -DNFS -DVPRINTF -DKVM -DSUNOS40 -DSUNOS41 -Isys XLIBS = -ltermlib -lkvm XDIRINSTALL = /usr/kvm X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o stream.o waitingfor.o filecount.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): sys $(INCS) X Xsys: X -mkdir sys X -ln -s /sys/* sys X -ln -s /sys/sys sys/h X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun.4.1--- LEN=`wc -c < Makefile.sun.4.1` if [ $LEN != 1201 ] ; then echo shar: File "Makefile.sun.4.1" was $LEN, should have been 1201 bytes fi if [ -f 'Makefile.sun4.3.2' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.sun4.3.2" exit 2 fi echo x - Makefile.sun4.3.2 sed -e 's/^X//' > Makefile.sun4.3.2 << '---END-OF-Makefile.sun4.3.2---' X# Makefile for SPS (Sun-4, SunOS Sys 4-3.2 Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DSUN -DBSD42 -DNFS -DVPRINTF -Isys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): sys $(INCS) X Xsys: X -mkdir sys X -ln -s /sys/* sys X -ln -s /sys/sys sys/h X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c $(LIBS) Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.sun4.3.2--- LEN=`wc -c < Makefile.sun4.3.2` if [ $LEN != 1066 ] ; then echo shar: File "Makefile.sun4.3.2" was $LEN, should have been 1066 bytes fi if [ -f 'Makefile.ultrix.2.0' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.ultrix.2.0" exit 2 fi echo x - Makefile.ultrix.2.0 sed -e 's/^X//' > Makefile.ultrix.2.0 << '---END-OF-Makefile.ultrix.2.0---' X# Makefile for SPS (Ultrix 2.0 UNIX Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DBSD42 -DULTRIX20 -DVPRINTF -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.ultrix.2.0--- LEN=`wc -c < Makefile.ultrix.2.0` if [ $LEN != 984 ] ; then echo shar: File "Makefile.ultrix.2.0" was $LEN, should have been 984 bytes fi if [ -f 'Makefile.ultrix.3.0' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "Makefile.ultrix.3.0" exit 2 fi echo x - Makefile.ultrix.3.0 sed -e 's/^X//' > Makefile.ultrix.3.0 << '---END-OF-Makefile.ultrix.3.0---' X# Makefile for SPS (Ultrix 2.0 UNIX Version) X XPROG = sps XOBJS = filecount.o findtty.o flagdecode.o flagsetup.o \ X getcmd.o getupage.o globals1.o globals2.o hashuid.o \ X initialise.o initsymbols.o inittty.o main.o mktree.o \ X needed.o openfiles.o percentmem.o prcmd.o prcpu.o \ X prheader.o printall.o printproc.o prsummary.o readstatus.o \ X selectproc.o selecttty.o termwidth.o ttystatus.o waitingfor.o XINCS = sps.h XCC = cc XCFLAGS = -DBSD42 -DULTRIX20 -DULTRIX30 -DVPRINTF -I/sys XLIBS = -ltermlib XDIRINSTALL = /bin X Xall: $(PROG) X.c.o: X $(CC) $(CFLAGS) -c -O -R $< X Xglobals1.o waitingfor.o: X $(CC) $(CFLAGS) -c -O $< X X$(OBJS): $(INCS) X X$(PROG): $(OBJS) X $(CC) -o $@ $(OBJS) $(LIBS) X Xinstall: $(PROG) X strip $(PROG) X mv $(PROG) $(DIRINSTALL)/$(PROG) X /etc/chown root $(DIRINSTALL)/$(PROG) X chgrp kmem $(DIRINSTALL)/$(PROG) X chmod 2755 $(DIRINSTALL)/$(PROG) X Xlint: X lint -x -b $(CFLAGS) *.c Xclean: X rm -f $(OBJS) $(PROG) ---END-OF-Makefile.ultrix.3.0--- LEN=`wc -c < Makefile.ultrix.3.0` if [ $LEN != 995 ] ; then echo shar: File "Makefile.ultrix.3.0" was $LEN, should have been 995 bytes fi if [ -f 'README' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "README" exit 2 fi echo x - README sed -e 's/^X//' > README << '---END-OF-README---' X SPS - Show Process Status X =========================== X X XIntroduction: X SPS is a intended to be used as a replacement for the standard X ps(1) program. Its advantages over ps(1) are that it shows more X useful information, that the displayed information is more X comprehensible and that it is faster. X X X SPS is currently implemented for the following operating systems and X architectures. The corresponding Makefiles are also shown here: X X Makefile.4.1 Standard 4.1bsd for Vax X Makefile.4.2 Standard 4.2bsd, Ultrix 1.x for Vax X Makefile.4.3 Standard 4.3bsd (or 4.3-tahoe) for Vax X Makefile.4.3+NFS 4.3bsd+NFS from Wisconsin (Mt. Xinu?, others?) X Makefile.dec3100 DECStation 3100 + Ultrix 3.0 (incomplete) X Makefile.sun.2.0 Sun 4.2 UNIX Release 2.0 - 2.2 for Sun-2 X Makefile.sun.3.0 Sun 4.2 UNIX Release 3.0 for Sun-2, Sun-3 X Makefile.sun.3.2 Sun 4.2 UNIX Release 3.2 for Sun-2, Sun-3 X Makefile.sun.4.0 SunOS 4.0 for Sun-2, Sun-3, Sun-4 X Makefile.sun.4.0+386i SunOS 4.0 for Sun 386i X Makefile.sun.4.1 SunOS 4.1 for Sun-2, Sun-3, Sun-4 X Makefile.sun4.3.2 SunOS Sys 4-3.2 for Sun-4 X Makefile.ultrix.2.0 DEC Ultrix 2.0 - 2.2 X Makefile.ultrix.3.0 DEC Ultrix 3.0 X X (I also have a somewhat ancient implementation for V7 on a PDP-11 as well X as Unisoft Version 1.3 on a MC68000 if anyone is interested). X X XWhat SPS does: X SPS displays wait channels symbolically, rather than as hexadecimal X addresses. (If you wish to teach SPS about a new sort of device, X you must add an entry in the symbol table (globals2.c) as well as X increasing the size of that table (NWAITSTATE in sps.h)). X X SPS sorts processes before listing them, the order reflecting the X relationship of the processes. A child process is listed X underneath its corresponding parent and is indented to depict the X exact relationship. SPS also indicates setuid processes. X X SPS displays such values as the resident and virtual sizes of X system processes. It accepts a whole range of options to control X the output. By default, SPS lists information about one's own X processes. Other options instruct it to be verbose (the "v" X option), to list all the command arguments of a process (the "w" X option) or to list the environment strings of that process (the "e" X option). Similarly, there are options to control which processes X are to be displayed. The "a" option tells it to describe all X processes and the "b" option tells it to describe "busy" processes; X the latter is useful if you wish to find out what is loading your X system. There are also options to select the output according to X user, controlling tty or process number. X X SPS keeps its information in an information file; by default, this X is /tmp/.spsinfo. This means that it can avoid having to do an X expensive nlist() operation each time it is run. It must be X reinitialised (with the "i" option) if new users are added to X /etc/passwd or if a new version of /vmunix is installed. X X XHow to build SPS: X 1. In order to compile and install SPS, first unbundle the four shell X archive files. X 2. Check that the define statements in sps.h are large enough for X your system. In particular, you may need to increase MAXTTYS X to reflect the number of tty devices in /dev. The parameter X MAXUSERS defines the maximum number of users defined in the X password file (or through the Yellow Pages). Because the X user-ids are held in an internal hash table, this should X probably be at least double the number of actual users. X 3. Choose an appropriate Makefile from the table above and compile X the source files. For example: X % make -f Makefile.sun.3.2 X 4. Try running SPS. First, a suitable information file must be X initialised. It should then be able to display information X concerning running processes on your system: X # Initialise SPS. Ignore any error messages at this stage. X % sps i X # Instruct SPS to list all active processes in verbose format. X % sps va X 5. If this all works, install SPS with the appropriate Makefile X and reinitialise it: X % make -f Makefile.sun.3.2 install X % sps -i X X XBug reports: X Send all bug reports, fixes, comments and suggestions to Robert Ward at - X X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ X J. Robert Ward, X Olsen & Associates, Seefeldstrasse 233, CH-8008 Zuerich, Switzerland X XTel.: +41 1 552224 Fax: +41 1 552282 Telex: 816656 XEmail: robert@olsen.uu.ch Uucp: uunet!chx400!olsen!robert XX.400: s=robert/ou=olsen/o=uucp/p=switch/a=arcom/c=ch X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---END-OF-README--- LEN=`wc -c < README` if [ $LEN != 4769 ] ; then echo shar: File "README" was $LEN, should have been 4769 bytes fi if [ -f 'RELEASENOTES' -a "${1}" != "-c" ] ; then echo shar: Won\'t overwrite existing file "RELEASENOTES" exit 2 fi echo x - RELEASENOTES sed -e 's/^X//' > RELEASENOTES << '---END-OF-RELEASENOTES---' X NEW RELEASE OF SPS X ===================== X X XThe files in this directory represent a major new release of the SPS Xprogram. One or two minor bugs have been corrected but, more Ximportantly, SPS has now been ported to run under the SunOS 4.0, 4.1 and XUltrix 2.x and 3.x operating systems. X X XGratitude and heart-felt thanks for these achievments should be Xdirected to Rob Lehman (and others?) at CUCCA, Charlie Kim X<cck@cunixc.cc.columbia.edu> at CUCCA and, in particular, to Alexander XDupuy <dupuy@ncs.columbia.edu> at the Columbia C.S. Dept. Rob Lehman Xadded the Ultrix 2.x support. Charlie Kim and Alexander Dupuy Ximplemented the SunOS 4.0 support and Alexander added support for the XNFS additions as well as incorporating general improvements to the code. XSakari Jalovaara <sja@sirius.hut.fi> at the Helsinki University of Technology XComputing Centre added the support for SunOS4.1. X X XThis release of SPS includes support for all(?) systems previously Xsupported, although it has not been tested under 4.1 or 4.2bsd, or Sun 4.2 XUNIX Release 2.x. New systems supported include Ultrix 2.x and SunOS 4.0 Xand SunOS 4.1. The support for Sun 2.x and 3.x releases has been Ximproved. Support for the DEC 3100 has been included, as yet incomplete. X XMinor fixes include: X One additional option [-c], identical to the ps(1) -c option, X has been added. X The code to warn if the passwd file is older than the info file X has been ifdef'ed out since this caused more grief than X benefit. The old code may be reactivated by a -DWARNPASSWD X compiler flag. X Under SunOS, a status of itty?? indicates a process that is waiting X to read or write to an iconified window. X X XFor SunOS 4.x users: X One additional file is included in this distribution, BUG-libkvm, X containing a (source-only, sorry) patch to fix a bug in the libkvm X library where the command arguments for the ksh (or "vi a=b c", for X that matter) are returned incorrectly buy kvm_getcmd(3). X XFor DecStation 3100 users: X The code that mimics the virtual to physical address translation is X incomplete. Upage information is accessed correctly but not the X command line arguments. If anyone knows how to make this code work, X please contact me. X X XBuilding and installing SPS works much like it did before, only now there are Xeven more Makefiles to choose from: X Makefile.4.1 Standard 4.1bsd for Vax X Makefile.4.2 Standard 4.2bsd, Ultrix 1.x for Vax X Makefile.4.3 Standard 4.3bsd (or 4.3-tahoe) for Vax X Makefile.4.3+NFS 4.3bsd+NFS from Wisconsin (Mt. Xinu?, others?) X Makefile.dec3100 DECStation 3100 + Ultrix 3.0 (incomplete) X Makefile.sun.2.0 Sun 4.2 UNIX Release 2.0 - 2.2 for Sun-2 X Makefile.sun.3.0 Sun 4.2 UNIX Release 3.0 for Sun-2, Sun-3 X Makefile.sun.3.2 Sun 4.2 UNIX Release 3.2 for Sun-2, Sun-3 X Makefile.sun.4.0 SunOS 4.0 for Sun-2, Sun-3, Sun-4 X Makefile.sun.4.0+386i SunOS 4.0 for Sun 386i X Makefile.sun.4.1 SunOS 4.1 for Sun-2, Sun-3, Sun-4 X Makefile.sun4.3.2 SunOS Sys 4-3.2 for Sun-4 X Makefile.ultrix.2.0 DEC Ultrix 2.0 - 2.2 X Makefile.ultrix.3.0 DEC Ultrix 3.0 X X X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ X J. Robert Ward, X Olsen & Associates, Seefeldstrasse 233, CH-8008 Zuerich, Switzerland X XTel.: +41 1 552224 Fax: +41 1 552282 Telex: 816656 XEmail: robert@olsen.uu.ch Uucp: uunet!chx400!olsen!robert XX.400: s=robert/ou=olsen/o=uucp/p=switch/a=arcom/c=ch X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---END-OF-RELEASENOTES--- LEN=`wc -c < RELEASENOTES` if [ $LEN != 3510 ] ; then echo shar: File "RELEASENOTES" was $LEN, should have been 3510 bytes fi exit 0