home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / sps / part03 / patches next >
Encoding:
Text File  |  1987-07-21  |  26.2 KB  |  824 lines

  1. diff -b -c sps/Makefile.4.2 sps.old/Makefile.4.2
  2. *** sps/Makefile.4.2    Fri Dec  5 09:22:35 1986
  3. --- sps.old/Makefile.4.2    Wed Dec 17 13:57:20 1986
  4. ***************
  5. *** 1,4 ****
  6. ! # Makefile for SPS (Vax 4.2BSD and Ultrix1.2 UNIX Version)
  7.   
  8.   PROG    =       sps
  9.   OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  10. --- 1,4 ----
  11. ! # Makefile for SPS (4.2BSD UNIX Version)
  12.   
  13.   PROG    =       sps
  14.   OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  15. ***************
  16. *** 11,17 ****
  17.   CC      =       cc
  18.   CFLAGS  =       -DBSD42 -I/sys
  19.   LIBS    =       -ltermlib
  20. - DIRINSTALL =    /bin
  21.   
  22.   all:            $(PROG)
  23.   .c.o:
  24. --- 11,16 ----
  25. ***************
  26. *** 27,36 ****
  27.   
  28.   install:        $(PROG)
  29.           strip $(PROG)
  30. !         mv $(PROG) $(DIRINSTALL)/$(PROG)
  31. !         /etc/chown root $(DIRINSTALL)/$(PROG)
  32. !         chgrp kmem $(DIRINSTALL)/$(PROG)
  33. !         chmod 2755 $(DIRINSTALL)/$(PROG)
  34.   
  35.   lint:
  36.           lint -x -b $(CFLAGS) *.c
  37. --- 26,33 ----
  38.   
  39.   install:        $(PROG)
  40.           strip $(PROG)
  41. !         mv $(PROG) /bin/$(PROG)
  42. !         /etc/chown root /bin/$(PROG)
  43.   
  44.   lint:
  45.           lint -x -b $(CFLAGS) *.c
  46. Only in sps: Makefile.4.3
  47. diff -b -c sps/Makefile.sun sps.old/Makefile.sun
  48. *** sps/Makefile.sun    Tue Nov 25 11:34:08 1986
  49. --- sps.old/Makefile.sun    Wed Dec 17 13:57:25 1986
  50. ***************
  51. *** 1,4 ****
  52. ! # Makefile for SPS (Sun-2 and Sun-3, 4.2BSD UNIX Version)
  53.   
  54.   PROG    =       sps
  55.   OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  56. --- 1,4 ----
  57. ! # Makefile for SPS (Sun 4.2BSD UNIX Version)
  58.   
  59.   PROG    =       sps
  60.   OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  61. ***************
  62. *** 11,17 ****
  63.   CC      =       cc
  64.   CFLAGS  =       -DSUN -DBSD42 -I/sys
  65.   LIBS    =       -ltermlib
  66. - DIRINSTALL    = /bin
  67.   
  68.   all:            $(PROG)
  69.   .c.o:
  70. --- 11,16 ----
  71. ***************
  72. *** 27,36 ****
  73.   
  74.   install:        $(PROG)
  75.           strip $(PROG)
  76. !         mv $(PROG) $(DIRINSTALL)/$(PROG)
  77. !         /etc/chown root $(DIRINSTALL)/$(PROG)
  78. !         chgrp kmem $(DIRINSTALL)/$(PROG)
  79. !         chmod 2755 $(DIRINSTALL)/$(PROG)
  80.   
  81.   lint:
  82.           lint -x -b $(CFLAGS) *.c
  83. --- 26,33 ----
  84.   
  85.   install:        $(PROG)
  86.           strip $(PROG)
  87. !         mv $(PROG) /bin/$(PROG)
  88. !         /etc/chown root /bin/$(PROG)
  89.   
  90.   lint:
  91.           lint -x -b $(CFLAGS) *.c
  92. diff -b -c sps/findtty.c sps.old/findtty.c
  93. *** sps/findtty.c    Tue Nov 25 11:34:10 1986
  94. --- sps.old/findtty.c    Wed Dec 17 13:57:30 1986
  95. ***************
  96. *** 1,5 ****
  97.   # include       "sps.h"
  98. - # include       <h/ioctl.h>
  99.   # include       <h/tty.h>
  100.   
  101.   /* FINDTTY - Attempts to determine to which tty a process is connected */
  102. --- 1,4 ----
  103. diff -b -c sps/flagsetup.c sps.old/flagsetup.c
  104. *** sps/flagsetup.c    Tue Nov 25 11:34:12 1986
  105. --- sps.old/flagsetup.c    Wed Dec 17 13:57:49 1986
  106. ***************
  107. *** 1,6 ****
  108.   # include       "sps.h"
  109.   # include       "flags.h"
  110. - # include       <h/ioctl.h>
  111.   # include       <h/tty.h>
  112.   
  113.   /*
  114. --- 1,5 ----
  115. diff -b -c sps/globals2.c sps.old/globals2.c
  116. *** sps/globals2.c    Tue Nov 25 11:34:15 1986
  117. --- sps.old/globals2.c    Wed Dec 17 13:58:26 1986
  118. ***************
  119. *** 40,67 ****
  120.       { "_usrpt",     0,  (caddr_t*)&Info.i_usrpt,    (char*)0        },
  121.       { "_cdevsw",    0,  (caddr_t*)&Info.i_cdevsw,   (char*)0        },
  122.   # ifdef BSD42
  123. - # ifndef SUN
  124.       { "_quota",     1,  (caddr_t*)&Info.i_quota0,   (char*)0        },
  125.       { "_nquota",    1,  (caddr_t*)&Info.i_nquota,   (char*)0        },
  126. - # endif SUN
  127.       { "_dmmin",     1,  (caddr_t*)&Info.i_dmmin,    (char*)0        },
  128.       { "_dmmax",     1,  (caddr_t*)&Info.i_dmmax,    (char*)0        },
  129.       { "_mbutl",     0,  (caddr_t*)&Info.i_mbutl,    (char*)0        },
  130.   # else
  131.       { "_hz",        1,  (caddr_t*)&Info.i_hz,       (char*)0        },
  132. ! # endif BSD42
  133.   # ifdef CHAOS
  134.       { "_Chconntab", 0,  &Info.i_Chconntab,          (char*)0        },
  135. ! # endif CHAOS
  136.       /* Kernel addresses associated with process wait states.
  137.          It is not important if some of these addresses are unresolved
  138.          at initialisation. */
  139. - # ifndef SUN
  140.       { "_fltab",     0,  &Info.i_waitstate[0],       "floppy"        },
  141.       { "_tu",        0,  &Info.i_waitstate[1],       "tu58"          },
  142. -     { "_lp_softc",  0,  &Info.i_waitstate[3],       "printr"        },
  143. - # endif SUN
  144.       { "_bfreelist", 0,  &Info.i_waitstate[2],       "buffer"        },
  145.       { "_lbolt",     0,  &Info.i_waitstate[4],       "lbolt"         },
  146.       { "_runin",     0,  &Info.i_waitstate[5],       "runin"         },
  147.       { "_runout",    0,  &Info.i_waitstate[6],       "runout"        },
  148. --- 40,63 ----
  149.       { "_usrpt",     0,  (caddr_t*)&Info.i_usrpt,    (char*)0        },
  150.       { "_cdevsw",    0,  (caddr_t*)&Info.i_cdevsw,   (char*)0        },
  151.   # ifdef BSD42
  152.       { "_quota",     1,  (caddr_t*)&Info.i_quota0,   (char*)0        },
  153.       { "_nquota",    1,  (caddr_t*)&Info.i_nquota,   (char*)0        },
  154.       { "_dmmin",     1,  (caddr_t*)&Info.i_dmmin,    (char*)0        },
  155.       { "_dmmax",     1,  (caddr_t*)&Info.i_dmmax,    (char*)0        },
  156.       { "_mbutl",     0,  (caddr_t*)&Info.i_mbutl,    (char*)0        },
  157.   # else
  158.       { "_hz",        1,  (caddr_t*)&Info.i_hz,       (char*)0        },
  159. ! # endif
  160.   # ifdef CHAOS
  161.       { "_Chconntab", 0,  &Info.i_Chconntab,          (char*)0        },
  162. ! # endif
  163.       /* Kernel addresses associated with process wait states.
  164.          It is not important if some of these addresses are unresolved
  165.          at initialisation. */
  166.       { "_fltab",     0,  &Info.i_waitstate[0],       "floppy"        },
  167.       { "_tu",        0,  &Info.i_waitstate[1],       "tu58"          },
  168.       { "_bfreelist", 0,  &Info.i_waitstate[2],       "buffer"        },
  169. +     { "_lp_softc",  0,  &Info.i_waitstate[3],       "printr"        },
  170.       { "_lbolt",     0,  &Info.i_waitstate[4],       "lbolt"         },
  171.       { "_runin",     0,  &Info.i_waitstate[5],       "runin"         },
  172.       { "_runout",    0,  &Info.i_waitstate[6],       "runout"        },
  173. ***************
  174. *** 70,106 ****
  175.       { "_freemem",   0,  &Info.i_waitstate[9],       "freemm"        },
  176.       { "_kernelmap", 0,  &Info.i_waitstate[10],      "kermap"        },
  177.       { "_cwaiting",  0,  &Info.i_waitstate[11],      "cwait"         },
  178.   # ifdef BSD42
  179. !     { "_selwait",   0,  &Info.i_waitstate[12],      "select"        },
  180. ! # endif BSD42
  181.   # ifdef CHAOS
  182. !     { "_Chrfclist", 0,  &Info.i_waitstate[13],      "chrfc"         },
  183.   # endif
  184. ! # ifndef SUN
  185. !     { "_rhpbuf",    0,  &Info.i_waitstate[14],      "rhpbuf"        },
  186. !     { "_rhtbuf",    0,  &Info.i_waitstate[15],      "rhtbuf"        },
  187. !     { "_ridcbuf",   0,  &Info.i_waitstate[16],      "ridcbf"        },
  188. !     { "_rikbuf",    0,  &Info.i_waitstate[17],      "rikbuf"        },
  189. !     { "_rmtbuf",    0,  &Info.i_waitstate[18],      "rmtbuf"        },
  190. !     { "_rrkbuf",    0,  &Info.i_waitstate[19],      "rrkbuf"        },
  191. !     { "_rrlbuf",    0,  &Info.i_waitstate[20],      "rrlbuf"        },
  192. !     { "_rrxbuf",    0,  &Info.i_waitstate[21],      "rrxbuf"        },
  193. !     { "_rswbuf",    0,  &Info.i_waitstate[22],      "rswbuf"        },
  194. !     { "_rtmbuf",    0,  &Info.i_waitstate[23],      "rtmbuf"        },
  195. !     { "_rtsbuf",    0,  &Info.i_waitstate[24],      "rtsbuf"        },
  196. !     { "_rudbuf",    0,  &Info.i_waitstate[25],      "rudbuf"        },
  197. !     { "_rupbuf",    0,  &Info.i_waitstate[26],      "rupbuf"        },
  198. !     { "_rutbuf",    0,  &Info.i_waitstate[27],      "rutbuf"        },
  199. !     { "_rvabuf",    0,  &Info.i_waitstate[28],      "rvabuf"        },
  200. !     { "_rvpbuf",    0,  &Info.i_waitstate[29],      "rvpbuf"        },
  201. !     { "_chtbuf",    0,  &Info.i_waitstate[30],      "chtbuf"        },
  202. !     { "_cmtbuf",    0,  &Info.i_waitstate[31],      "cmtbuf"        },
  203. !     { "_ctmbuf",    0,  &Info.i_waitstate[32],      "ctmbuf"        },
  204. !     { "_ctsbuf",    0,  &Info.i_waitstate[33],      "ctsbuf"        },
  205. !     { "_cutbuf",    0,  &Info.i_waitstate[34],      "cutbuf"        },
  206. ! # else
  207. !     { "_async_bufhead", 0,  &Info.i_waitstate[14],  "async"        },
  208. !     { "_desktops",    0,  &Info.i_waitstate[15],    "dtops"        },
  209. ! # endif SUN
  210.       { (char*)0,     0,  (caddr_t*)0,                (char*)0        }
  211.   } ;
  212. --- 66,100 ----
  213.       { "_freemem",   0,  &Info.i_waitstate[9],       "freemm"        },
  214.       { "_kernelmap", 0,  &Info.i_waitstate[10],      "kermap"        },
  215.       { "_cwaiting",  0,  &Info.i_waitstate[11],      "cwait"         },
  216. +     { "_rhpbuf",    0,  &Info.i_waitstate[12],      "rhpbuf"        },
  217. +     { "_rhtbuf",    0,  &Info.i_waitstate[13],      "rhtbuf"        },
  218. +     { "_ridcbuf",   0,  &Info.i_waitstate[14],      "ridcbf"        },
  219. +     { "_rikbuf",    0,  &Info.i_waitstate[15],      "rikbuf"        },
  220. +     { "_rmtbuf",    0,  &Info.i_waitstate[16],      "rmtbuf"        },
  221. +     { "_rrkbuf",    0,  &Info.i_waitstate[17],      "rrkbuf"        },
  222. +     { "_rrlbuf",    0,  &Info.i_waitstate[18],      "rrlbuf"        },
  223. +     { "_rrxbuf",    0,  &Info.i_waitstate[19],      "rrxbuf"        },
  224. +     { "_rswbuf",    0,  &Info.i_waitstate[20],      "rswbuf"        },
  225. +     { "_rtmbuf",    0,  &Info.i_waitstate[21],      "rtmbuf"        },
  226. +     { "_rtsbuf",    0,  &Info.i_waitstate[22],      "rtsbuf"        },
  227. +     { "_rudbuf",    0,  &Info.i_waitstate[23],      "rudbuf"        },
  228. +     { "_rupbuf",    0,  &Info.i_waitstate[24],      "rupbuf"        },
  229. +     { "_rutbuf",    0,  &Info.i_waitstate[25],      "rutbuf"        },
  230. +     { "_rvabuf",    0,  &Info.i_waitstate[26],      "rvabuf"        },
  231. +     { "_rvpbuf",    0,  &Info.i_waitstate[27],      "rvpbuf"        },
  232. +     { "_chtbuf",    0,  &Info.i_waitstate[28],      "chtbuf"        },
  233. +     { "_cmtbuf",    0,  &Info.i_waitstate[29],      "cmtbuf"        },
  234. +     { "_ctmbuf",    0,  &Info.i_waitstate[30],      "ctmbuf"        },
  235. +     { "_ctsbuf",    0,  &Info.i_waitstate[31],      "ctsbuf"        },
  236. +     { "_cutbuf",    0,  &Info.i_waitstate[32],      "cutbuf"        },
  237.   # ifdef BSD42
  238. !     { "_selwait",   0,  &Info.i_waitstate[33],      "select"        },
  239. ! # endif
  240.   # ifdef CHAOS
  241. !     { "_Chrfclist", 0,  &Info.i_waitstate[34],      "chrfc"         },
  242.   # endif
  243. ! # ifdef SUN
  244. !     { "_async_bufhead", 0,  &Info.i_waitstate[35],  "async"        },
  245. ! # endif
  246.       { (char*)0,     0,  (caddr_t*)0,                (char*)0        }
  247.   } ;
  248. diff -b -c sps/hashuid.c sps.old/hashuid.c
  249. *** sps/hashuid.c    Tue Nov 25 11:34:16 1986
  250. --- sps.old/hashuid.c    Wed Dec 17 13:58:30 1986
  251. ***************
  252. *** 1,8 ****
  253.   # include       "sps.h"
  254.   
  255.   /* The hashing functions themselves ... */
  256. ! # define        HASHFN1( a )            (((unsigned)(a)*91 + 17) % MAXUSERID)
  257. ! # define        HASHFN2( a )            (((unsigned)(a) + 47) % MAXUSERID)
  258.   
  259.   /*
  260.   ** HASHUID - Returns a pointer to a slot in the hash table that corresponds
  261. --- 1,8 ----
  262.   # include       "sps.h"
  263.   
  264.   /* The hashing functions themselves ... */
  265. ! # define        HASHFN1( a )            (((a)*91 + 17) % MAXUSERID)
  266. ! # define        HASHFN2( a )            (((a) + 47) % MAXUSERID)
  267.   
  268.   /*
  269.   ** HASHUID - Returns a pointer to a slot in the hash table that corresponds
  270. diff -b -c sps/initsymbols.c sps.old/initsymbols.c
  271. *** sps/initsymbols.c    Fri Dec  5 09:47:23 1986
  272. --- sps.old/initsymbols.c    Wed Dec 17 13:58:38 1986
  273. ***************
  274. *** 48,54 ****
  275.           sysperror() ;
  276.       }
  277.       /* Get kernel addresses */
  278. !     (void)nlist( filesymbol, np0 ) ;              
  279.       if ( np0[0].n_value == -1 )
  280.       {
  281.           fprintf( stderr, "sps - Can't read symbol file %s", filesymbol);
  282. --- 48,54 ----
  283.           sysperror() ;
  284.       }
  285.       /* Get kernel addresses */
  286. !     nlist( filesymbol, np0 ) ;              
  287.       if ( np0[0].n_value == -1 )
  288.       {
  289.           fprintf( stderr, "sps - Can't read symbol file %s", filesymbol);
  290. diff -b -c sps/inittty.c sps.old/inittty.c
  291. *** sps/inittty.c    Tue Nov 25 11:34:17 1986
  292. --- sps.old/inittty.c    Wed Dec 17 13:58:48 1986
  293. ***************
  294. *** 1,6 ****
  295.   # include       "sps.h"
  296.   # include       <h/conf.h>
  297. - # include       <h/ioctl.h>
  298.   # include       <h/tty.h>
  299.   # include       <sys/stat.h>
  300.   # include       <stdio.h>
  301. --- 1,5 ----
  302. diff -b -c sps/main.c sps.old/main.c
  303. *** sps/main.c    Tue Nov 25 11:34:18 1986
  304. --- sps.old/main.c    Wed Dec 17 13:59:04 1986
  305. ***************
  306. *** 1,14 ****
  307.   # include       "sps.h"
  308.   # include       "flags.h"
  309.   # include       <h/text.h>
  310. - # include       <sys/stat.h>
  311.   # include       <stdio.h>
  312.   
  313.   /* SPS - Show Process Status */
  314. ! /* J. R. Ward - Hasler AG Bern, CH - 24 May 1985 */
  315. ! /*                     26 Nov 1986 */
  316.   main ( argc,argv )
  317.   
  318.   int                             argc ;
  319. --- 1,10 ----
  320.   # include       "sps.h"
  321.   # include       "flags.h"
  322.   # include       <h/text.h>
  323.   # include       <stdio.h>
  324.   
  325.   /* SPS - Show Process Status */
  326. ! /* J. R. Ward - Hasler AG Bern - 24 May 1985 */
  327.   main ( argc,argv )
  328.   
  329.   int                             argc ;
  330. ***************
  331. *** 19,26 ****
  332.       register struct process *process ;
  333.       register struct text    *text ;
  334.       int                     flinfo ;
  335. -     char            *fileinfo, *filesymbol ;
  336. -     struct stat        sinfo, ssymbol, spasswd ;
  337.       extern struct flags     Flg ;
  338.       extern struct info      Info ;
  339.       extern int              Flmem ;
  340. --- 15,20 ----
  341. ***************
  342. *** 29,36 ****
  343.       char                    *getcore() ;
  344.       struct process          *needed(), *mktree() ;
  345.   
  346. !     /* Renice as fast as possible for root only (Suggested by Jeff Mogul,
  347. !        gregorio!mogul) */
  348.       if ( !getuid() )
  349.           (void)nice( -40 ) ;
  350.       /* Decode the flag arguments */
  351. --- 23,29 ----
  352.       char                    *getcore() ;
  353.       struct process          *needed(), *mktree() ;
  354.   
  355. !     /* Renice as fast as possible for root (Suggested by Gregorio!mogul) */
  356.       if ( !getuid() )
  357.           (void)nice( -40 ) ;
  358.       /* Decode the flag arguments */
  359. ***************
  360. *** 56,82 ****
  361.           initialise() ;          
  362.           exit( 0 ) ;
  363.       }
  364. -     /* Check that the information file is newer than the symbol and
  365. -        password files, suggested by gregorio!mogul */
  366. -     fileinfo = Flg.flg_j ? Flg.flg_j : FILE_INFO ;
  367. -     filesymbol = Flg.flg_s ? Flg.flg_s : FILE_SYMBOL ;
  368. -     flinfo = openfile( fileinfo ) ;
  369. -     (void)fstat( flinfo, &sinfo ) ;
  370. -     if ( !stat( filesymbol, &ssymbol ) &&
  371. -         sinfo.st_mtime < ssymbol.st_mtime )
  372. -         fprintf( stderr,
  373. -            "sps - WARNING: Info file `%s' is older than symbol file `%s'\n",
  374. -             fileinfo, filesymbol ) ;
  375. -     if ( !stat( FILE_PASSWD, &spasswd ) &&
  376. -         sinfo.st_mtime < spasswd.st_mtime )
  377. -         fprintf( stderr,
  378. -            "sps - WARNING: Info file `%s' is older than passwd file `%s'\n",
  379. -             fileinfo, FILE_PASSWD ) ;
  380.       /* Read the information file */
  381.       if ( read( flinfo, (char*)&Info, sizeof( struct info ) )
  382.       != sizeof( struct info ) )
  383.       {
  384. !         fprintf( stderr, "sps - Can't read info file `%s'", fileinfo ) ;
  385.           sysperror() ;
  386.       }
  387.       (void)close( flinfo ) ;
  388. --- 49,61 ----
  389.           initialise() ;          
  390.           exit( 0 ) ;
  391.       }
  392.       /* Read the information file */
  393. +     flinfo = openfile( Flg.flg_j ? Flg.flg_j : FILE_INFO ) ;
  394.       if ( read( flinfo, (char*)&Info, sizeof( struct info ) )
  395.       != sizeof( struct info ) )
  396.       {
  397. !         fprintf( stderr, "sps - Can't read info file %s",
  398. !             Flg.flg_j ? Flg.flg_j : FILE_INFO ) ;
  399.           sysperror() ;
  400.       }
  401.       (void)close( flinfo ) ;
  402. diff -b -c sps/printproc.c sps.old/printproc.c
  403. *** sps/printproc.c    Fri Dec  5 09:48:22 1986
  404. --- sps.old/printproc.c    Wed Dec 17 13:59:53 1986
  405. ***************
  406. *** 32,38 ****
  407.           p->pr_p.p_flag & SDETACH ? '_' :
  408.   # endif
  409.           p->pr_p.p_pgrp == p->pr_tty->l_pgrp ? '.' : ' ' ) ;
  410. !     hp = hashuid( (int)p->pr_p.p_uid ) ;
  411.       if ( !md  )                             
  412.       {       /* If a top-level process, list the user name */
  413.           if ( hp )
  414. --- 32,38 ----
  415.           p->pr_p.p_flag & SDETACH ? '_' :
  416.   # endif
  417.           p->pr_p.p_pgrp == p->pr_tty->l_pgrp ? '.' : ' ' ) ;
  418. !     hp = hashuid( p->pr_p.p_uid ) ;
  419.       if ( !md  )                             
  420.       {       /* If a top-level process, list the user name */
  421.           if ( hp )
  422. diff -b -c sps/selectproc.c sps.old/selectproc.c
  423. *** sps/selectproc.c    Fri Dec  5 09:02:28 1986
  424. --- sps.old/selectproc.c    Wed Dec 17 14:00:04 1986
  425. ***************
  426. *** 1,8 ****
  427.   # include       "sps.h"
  428.   # include       "flags.h"
  429. - # ifdef USELOGINUID
  430. - # include    <pwd.h>
  431. - # endif USELOGINUID
  432.   
  433.   /*
  434.   ** SELECTPROC - Given a process structure, this procedure decides whether
  435. --- 1,5 ----
  436. ***************
  437. *** 17,28 ****
  438.   {
  439.       register union flaglist *fp ;
  440.       register struct process *pp ;
  441. - #ifdef USELOGINUID
  442. -     char            *username ;
  443. -     struct passwd        *pw ;
  444. -     char            *getlogin() ;
  445. -     struct passwd        *getpwnam() ;
  446. - #endif USELOGINUID
  447.       extern struct flags     Flg ;
  448.   
  449.       /* Flg.flg_AZ is an internal flag set if one of flags `A' to `Z'
  450. --- 14,19 ----
  451. ***************
  452. *** 29,43 ****
  453.          was specified. If this is not set, a process is listed only
  454.          if it or one of its ancestors belongs to the invoking user. */
  455.       if ( !Flg.flg_AZ )
  456. -     {
  457. - #ifdef USELOGINUID
  458. -         thisuid = (username = getlogin())
  459. -             && (pw = getpwnam( username )) ? pw->pw_uid : getuid() ;
  460. - #endif USELOGINUID
  461.           for ( pp = p ; pp > &process[1] ; pp = pp->pr_pptr )
  462.               if ( thisuid == pp->pr_p.p_uid )
  463.                   return ( 1 ) ;
  464. -     }
  465.       if ( Flg.flg_A )
  466.           return ( 1 ) ;
  467.       if ( Flg.flg_P )
  468. --- 20,28 ----
  469. diff -b -c sps/sps.h sps.old/sps.h
  470. *** sps/sps.h    Tue Nov 25 11:34:28 1986
  471. --- sps.old/sps.h    Wed Dec 17 14:00:12 1986
  472. ***************
  473. *** 9,25 ****
  474.   */
  475.   # define    MAXUSERID    100
  476.   /* Maximum # ttys to be considered ... */
  477. ! # define    MAXTTYS        65
  478.   /* Maximum user name length ... */
  479.   # define    UNAMELEN    8
  480.   /* Maximum process-id not to be considered busy ... */
  481.   # define    MSPID        2
  482.   /* # of wait states defined in the `struct info' ... */
  483. ! # ifdef SUN
  484. ! # define    NWAITSTATE    16
  485. ! # else
  486. ! # define    NWAITSTATE    35
  487. ! # endif
  488.   
  489.   /* Convert clicks to kbytes ... */
  490.   # ifdef SUN
  491. --- 9,21 ----
  492.   */
  493.   # define        MAXUSERID       100
  494.   /* Maximum # ttys to be considered ... */
  495. ! # define        MAXTTYS         60
  496.   /* Maximum user name length ... */
  497.   # define        UNAMELEN        8
  498.   /* Maximum process-id not to be considered busy ... */
  499.   # define        MSPID           2
  500.   /* # of wait states defined in the `struct info' ... */
  501. ! # define        NWAITSTATE      36
  502.   
  503.   /* Convert clicks to kbytes ... */
  504.   # ifdef SUN
  505. ***************
  506. *** 35,41 ****
  507.   # define    FILE_DEV    "/dev"        /* Directory of tty entries */
  508.   # define    FILE_SYMBOL    "/vmunix"    /* Symbol file for nlist() */
  509.   # define    FILE_INFO    "/etc/spsinfo"    /* Sps information file */
  510. - # define    FILE_PASSWD    "/etc/passwd"    /* User database */
  511.   
  512.   /* Structure to hold necessary information concerning a tty ... */
  513.   struct ttyline
  514. --- 31,36 ----
  515. ***************
  516. *** 49,55 ****
  517.   /* Structure holding a single hash table entry ... */
  518.   struct hashtab
  519.   {
  520. !     short            h_uid ;        /* Uid of user entry */
  521.       char            h_uname[ UNAMELEN ] ; /* Corresponding name */
  522.   } ;
  523.   
  524. --- 44,50 ----
  525.   /* Structure holding a single hash table entry ... */
  526.   struct hashtab
  527.   {
  528. !     unsigned short          h_uid ;         /* Uid of user entry */
  529.       char                    h_uname[ UNAMELEN ] ; /* Corresponding name */
  530.   } ;
  531.   
  532. diff -b -c sps/termwidth.c sps.old/termwidth.c
  533. *** sps/termwidth.c    Thu Dec 11 10:42:33 1986
  534. --- sps.old/termwidth.c    Wed Dec 17 14:00:17 1986
  535. ***************
  536. *** 1,5 ****
  537. - #include    <sys/ioctl.h>
  538.   /*
  539.   ** TERMWIDTH - Sets the external variable `Termwidth' to the # of columns
  540.   ** on the terminal.
  541. --- 1,3 ----
  542. ***************
  543. *** 8,28 ****
  544.   {
  545.       register char           *termtype ;
  546.       register int            twidth ;
  547. - #ifdef TIOCGWINSZ
  548. -     struct winsize        w ;
  549. - #endif
  550.       char                    buf[ 1025 ] ;
  551.       extern unsigned         Termwidth ;
  552.       char                    *getenv() ;
  553.   
  554. - #ifdef TIOCGWINSZ
  555. -     w.ws_col = 0 ;
  556. -     if ( !ioctl( 0, TIOCGWINSZ, &w ) && w.ws_col )
  557. -     {
  558. -         Termwidth = w.ws_col ;
  559. -         return ;
  560. -     }
  561. - #endif
  562.       Termwidth = 80 ;
  563.       if ( !(termtype = getenv( "TERM" )) )
  564.           return ;
  565. --- 6,15 ----
  566. diff -b -c sps/ttystatus.c sps.old/ttystatus.c
  567. *** sps/ttystatus.c    Tue Nov 25 11:34:28 1986
  568. --- sps.old/ttystatus.c    Wed Dec 17 14:00:20 1986
  569. ***************
  570. *** 1,7 ****
  571.   # include       "sps.h"
  572.   # include       "flags.h"
  573.   # include       <stdio.h>
  574. - # include       <h/ioctl.h>
  575.   # include       <h/tty.h>
  576.   # ifdef CHAOS
  577.   # include       <chunix/chsys.h>
  578. --- 1,6 ----
  579. diff -b -c sps/waitingfor.c sps.old/waitingfor.c
  580. *** sps/waitingfor.c    Fri Dec  5 11:23:05 1986
  581. --- sps.old/waitingfor.c    Wed Dec 17 14:00:31 1986
  582. ***************
  583. *** 1,4 ****
  584. --- 1,5 ----
  585.   # include       "sps.h"
  586. + # include       <h/tty.h>
  587.   # include       <h/text.h>
  588.   # ifdef SUN
  589.   # include       <h/vnode.h>
  590. ***************
  591. *** 5,22 ****
  592.   # include       <ufs/inode.h>
  593.   # else
  594.   # include       <h/inode.h>
  595. ! # endif SUN
  596. ! # include       <h/ioctl.h>
  597. ! # include       <h/tty.h>
  598.   # include       <h/buf.h>
  599.   # ifdef BSD42
  600. - # ifndef SUN
  601.   # include       <h/quota.h>
  602. - # endif SUN
  603.   # include       <h/mbuf.h>
  604.   # include       <h/socket.h>
  605.   # include       <h/socketvar.h>
  606. ! # endif BSD42
  607.   
  608.   /* 1 if `w' is in the address range defined by `a1' and `a2' ... */
  609.   # define        INRANGE( w, a1, a2 ) \
  610. --- 6,19 ----
  611.   # include       <ufs/inode.h>
  612.   # else
  613.   # include       <h/inode.h>
  614. ! # endif
  615.   # include       <h/buf.h>
  616.   # ifdef BSD42
  617.   # include       <h/quota.h>
  618.   # include       <h/mbuf.h>
  619.   # include       <h/socket.h>
  620.   # include       <h/socketvar.h>
  621. ! # endif
  622.   
  623.   /* 1 if `w' is in the address range defined by `a1' and `a2' ... */
  624.   # define        INRANGE( w, a1, a2 ) \
  625. ***************
  626. *** 35,41 ****
  627.   # ifdef BSD42
  628.       struct socket           sc ;
  629.   # endif
  630. -     int            rc ;
  631.       static char             wbuf[ 8 ] ;
  632.       extern struct info      Info ;
  633.       extern struct symbol    Symbollist[] ;
  634. --- 32,37 ----
  635. ***************
  636. *** 59,75 ****
  637.       if ( INRANGE( w, Info.i_text0, &Info.i_text0[ Info.i_ntext ] ) )
  638.           return ( "swtext" ) ;
  639.   # ifdef BSD42
  640. - # ifndef SUN
  641.       /* Waiting for an event associated with the quota system ? */
  642.       if ( INRANGE( w, Info.i_quota0, &Info.i_quota0[ Info.i_nquota ] ) )
  643.           return ( "quota" ) ;
  644. ! # endif SUN
  645. ! # endif BSD42
  646.       /* Waiting for tty I/O ? If so, find which tty it is */
  647.       for ( lp = Info.i_ttyline ; lp->l_name[0] ; lp++ )
  648.           if ( INRANGE( w, &lp->l_addr[0], &lp->l_addr[1] ) )
  649.           {
  650. !             switch ( (int)w - (int)lp->l_addr )
  651.               {
  652.                   case (int)&((struct tty*)0)->t_rawq :
  653.                       /* Read from a tty or slave pty */
  654. --- 55,69 ----
  655.       if ( INRANGE( w, Info.i_text0, &Info.i_text0[ Info.i_ntext ] ) )
  656.           return ( "swtext" ) ;
  657.   # ifdef BSD42
  658.       /* Waiting for an event associated with the quota system ? */
  659.       if ( INRANGE( w, Info.i_quota0, &Info.i_quota0[ Info.i_nquota ] ) )
  660.           return ( "quota" ) ;
  661. ! # endif
  662.       /* Waiting for tty I/O ? If so, find which tty it is */
  663.       for ( lp = Info.i_ttyline ; lp->l_name[0] ; lp++ )
  664.           if ( INRANGE( w, &lp->l_addr[0], &lp->l_addr[1] ) )
  665.           {
  666. !             switch ( w - (int)lp->l_addr )
  667.               {
  668.                   case (int)&((struct tty*)0)->t_rawq :
  669.                       /* Read from a tty or slave pty */
  670. ***************
  671. *** 111,117 ****
  672.               case (int)&((struct inode*)0)->i_shlockc :
  673.                   /* Shared lock on this inode */
  674.                   return ( "shlock" ) ;
  675. ! # endif SUN
  676.   # else
  677.               case 1 :
  678.                   return ( "wpipe" ) ;
  679. --- 105,111 ----
  680.               case (int)&((struct inode*)0)->i_shlockc :
  681.                   /* Shared lock on this inode */
  682.                   return ( "shlock" ) ;
  683. ! # endif
  684.   # else
  685.               case 1 :
  686.                   return ( "wpipe" ) ;
  687. ***************
  688. *** 119,125 ****
  689.                   return ( "rpipe" ) ;
  690.               case (int)&((struct inode*)0)->i_un.i_group.g_datq :
  691.                   return ( "rmux" ) ;
  692. ! # endif BSD42
  693.               default :
  694.                   /* Inode probably locked */
  695.                   return ( "inode" ) ;
  696. --- 113,119 ----
  697.                   return ( "rpipe" ) ;
  698.               case (int)&((struct inode*)0)->i_un.i_group.g_datq :
  699.                   return ( "rmux" ) ;
  700. ! # endif
  701.               default :
  702.                   /* Inode probably locked */
  703.                   return ( "inode" ) ;
  704. ***************
  705. *** 132,146 ****
  706.               - (int)&((struct mbuf*)0)->m_dat[0] )
  707.           {
  708.               case (int)&((struct socket*)0)->so_timeo :
  709. !                 /* Socket timeout event - Guess why */
  710. !                 rc = getsocket( (struct socket*)(w
  711. !                     - (int)&((struct socket*)0)->so_timeo),
  712. !                         &sc ) ;
  713. !                 return ( rc && (sc.so_state & SS_ISCONNECTING)
  714. !                     ? "connct" 
  715. !                     : rc && ((sc.so_options & SO_ACCEPTCONN)
  716. !                       && !sc.so_qlen)
  717. !                     ? "accept" : "socket" ) ;
  718.               case (int)&((struct socket*)0)->so_rcv.sb_cc :
  719.                   /* Read from an empty socket. Here we actually
  720.                      attempt to determine whether the socket
  721. --- 126,133 ----
  722.               - (int)&((struct mbuf*)0)->m_dat[0] )
  723.           {
  724.               case (int)&((struct socket*)0)->so_timeo :
  725. !                 /* Socket timeout event */
  726. !                 return ( "socket" ) ;
  727.               case (int)&((struct socket*)0)->so_rcv.sb_cc :
  728.                   /* Read from an empty socket. Here we actually
  729.                      attempt to determine whether the socket
  730. ***************
  731. *** 151,166 ****
  732.                       - (int)&((struct socket*)0)->so_rcv.sb_cc),
  733.                           &sc )
  734.                       && sc.so_type == SOCK_STREAM
  735. - #ifdef BSD43
  736. -                     && ((sc.so_state
  737. -                         & (SS_ISCONNECTED|SS_CANTSENDMORE))
  738. -                         == (SS_ISCONNECTED|SS_CANTSENDMORE))
  739. - #else
  740.                       && !sc.so_rcv.sb_hiwat
  741.                       && !sc.so_rcv.sb_mbmax
  742.                       && (sc.so_state
  743.                           & (SS_ISCONNECTED|SS_CANTRCVMORE))
  744. - #endif BSD43
  745.                       ? "rpipe" : "rsockt" ) ;
  746.               case (int)&((struct socket*)0)->so_snd.sb_cc :
  747.                   /* Write to a full socket. Again, we try
  748. --- 138,147 ----
  749. ***************
  750. *** 169,191 ****
  751.                   return ( getsocket( (struct socket*)(w
  752.                       - (int)&((struct socket*)0)->so_snd.sb_cc),
  753.                           &sc )
  754. - #ifdef BSD43
  755.                       && sc.so_type == SOCK_STREAM
  756. -                     && ((sc.so_state
  757. -                         & (SS_ISCONNECTED|SS_CANTRCVMORE))
  758. -                         == (SS_ISCONNECTED|SS_CANTRCVMORE))
  759. - #else
  760.                       && sc.so_rcv.sb_hiwat == 2048
  761.                       && sc.so_rcv.sb_mbmax == 4096
  762.                       && (sc.so_state
  763.                           & (SS_ISCONNECTED|SS_CANTSENDMORE))
  764. - #endif BSD43
  765.                       ? "wpipe" : "wsockt" ) ;
  766.               default :
  767.                   /* Other mbuf event */
  768.                   return ( "mbuf" ) ;
  769.           }
  770. ! # endif SUN
  771.       /* Look in the symbol table for known wait addresses. */
  772.       for ( s = Symbollist ; s->s_kname ; s++ )
  773.           if ( s->s_wait && w == *s->s_info )
  774. --- 150,166 ----
  775.                   return ( getsocket( (struct socket*)(w
  776.                       - (int)&((struct socket*)0)->so_snd.sb_cc),
  777.                           &sc )
  778.                       && sc.so_type == SOCK_STREAM
  779.                       && sc.so_rcv.sb_hiwat == 2048
  780.                       && sc.so_rcv.sb_mbmax == 4096
  781.                       && (sc.so_state
  782.                           & (SS_ISCONNECTED|SS_CANTSENDMORE))
  783.                       ? "wpipe" : "wsockt" ) ;
  784.               default :
  785.                   /* Other mbuf event */
  786.                   return ( "mbuf" ) ;
  787.           }
  788. ! # endif
  789.       /* Look in the symbol table for known wait addresses. */
  790.       for ( s = Symbollist ; s->s_kname ; s++ )
  791.           if ( s->s_wait && w == *s->s_info )
  792. ***************
  793. *** 196,202 ****
  794.       (void)sprintf( wbuf, "x%05x", w ) ;
  795.   # else
  796.       (void)sprintf( wbuf, "x%05x", w - 0x80000000 ) ;
  797. ! # endif SUN
  798.       return ( wbuf ) ;
  799.   }
  800.   
  801. --- 171,177 ----
  802.       (void)sprintf( wbuf, "x%05x", w ) ;
  803.   # else
  804.       (void)sprintf( wbuf, "x%05x", w - 0x80000000 ) ;
  805. ! # endif
  806.       return ( wbuf ) ;
  807.   }
  808.   
  809. ***************
  810. *** 217,220 ****
  811.       return ( read( Flkmem, (char*)s, sizeof( struct socket ) )
  812.           == sizeof( struct socket ) ) ;
  813.   }
  814. ! # endif BSD42
  815. --- 192,195 ----
  816.       return ( read( Flkmem, (char*)s, sizeof( struct socket ) )
  817.           == sizeof( struct socket ) ) ;
  818.   }
  819. ! # endif
  820.  
  821.