[BACK]Return to modstat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / modstat

Diff for /src/usr.bin/modstat/Attic/modstat.c between version 1.14 and 1.15

version 1.14, 2001/08/18 22:06:44 version 1.15, 2002/01/08 04:59:24
Line 48 
Line 48 
 #include <errno.h>  #include <errno.h>
 #include "pathnames.h"  #include "pathnames.h"
   
 void  #define POINTERSIZE     ((int)(2 * sizeof(void*)))
 usage()  
 {  
   
         fprintf(stderr, "usage: modstat [-i moduleid] [-n modulename]\n");  
         exit(1);  
 }  
   
 static char *type_names[] = {  static char *type_names[] = {
         "SYSCALL",          "SYSCALL",
         "VFS",          "VFS",
Line 65 
Line 59 
         "MISC"          "MISC"
 };  };
   
 int  static void
 dostat(devfd, modnum, modname)  usage()
         int devfd;  
         int modnum;  
         char *modname;  
 {  {
           extern char *__progname;
   
           (void)fprintf(stderr, "usage: %s [-i id] [-n name]\n", __progname);
           exit(1);
   }
   
   static int
   dostat(int devfd, int modnum, char *modname)
   {
         char name[MAXLKMNAME];          char name[MAXLKMNAME];
         struct lmc_stat sbuf;          struct lmc_stat sbuf;
   
Line 98 
Line 98 
         }          }
   
         /* Decode this stat buffer... */          /* Decode this stat buffer... */
         printf("%-7s %3d %3ld %08lx %04lx %8lx %3ld %s\n",          printf("%-7s %3d %3ld %0*lx %04lx %0*x %3ld %s\n",
             type_names[sbuf.type], sbuf.id, sbuf.offset,              type_names[sbuf.type], sbuf.id, sbuf.offset, POINTERSIZE,
             (long)sbuf.area, (long)sbuf.size, (long)sbuf.private,              (long)sbuf.area, (long)sbuf.size, POINTERSIZE,
             (long)sbuf.ver, sbuf.name);              (long)sbuf.private, (long)sbuf.ver, sbuf.name);
   
         return 0;          return 0;
 }  }
Line 145 
Line 145 
         setegid(getgid());          setegid(getgid());
         setgid(getgid());          setgid(getgid());
   
         printf("Type     Id Off Loadaddr Size Info     Rev Module Name\n");          printf("Type     Id Off %-*s Size %-*s Rev Module Name\n",
                   POINTERSIZE, "Loadaddr", POINTERSIZE, "Info");
   
         if (modnum != -1 || modname != NULL) {          if (modnum != -1 || modname != NULL) {
                 if (dostat(devfd, modnum, modname))                  if (dostat(devfd, modnum, modname))

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15