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

Diff for /src/usr.bin/netstat/mbuf.c between version 1.31 and 1.32

version 1.31, 2010/07/08 08:47:07 version 1.32, 2014/07/02 00:12:34
Line 49 
Line 49 
 typedef int bool;  typedef int bool;
   
 struct  mbstat mbstat;  struct  mbstat mbstat;
 struct pool mbpool, mclpools[MCLPOOLS];  struct kinfo_pool mbpool, mclpools[MCLPOOLS];
 int     mclp;  int     mclp;
 char    *mclnames[] = {  char    *mclnames[] = {
         "mcl2k", "mcl4k", "mcl8k", "mcl9k", "mcl12k", "mcl16k", "mcl64k"          "mcl2k", "mcl4k", "mcl8k", "mcl9k", "mcl12k", "mcl16k", "mcl64k"
Line 82 
Line 82 
         unsigned long totmem, totused, totmbufs;          unsigned long totmem, totused, totmbufs;
         int totpct;          int totpct;
         int i, mib[4], npools;          int i, mib[4], npools;
         struct pool pool;          struct kinfo_pool pool;
         struct mbtypes *mp;          struct mbtypes *mp;
         size_t size;          size_t size;
         int page_size = getpagesize();          int page_size = getpagesize();
Line 122 
Line 122 
                 mib[1] = KERN_POOL;                  mib[1] = KERN_POOL;
                 mib[2] = KERN_POOL_POOL;                  mib[2] = KERN_POOL_POOL;
                 mib[3] = i;                  mib[3] = i;
                 size = sizeof(struct pool);                  size = sizeof(pool);
                 if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) {                  if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) {
                         if (errno == ENOENT)                          if (errno == ENOENT)
                                 continue;                                  continue;
Line 140 
Line 140 
                 }                  }
   
                 if (!strncmp(name, "mbpl", strlen("mbpl")))                  if (!strncmp(name, "mbpl", strlen("mbpl")))
                         bcopy(&pool, &mbpool, sizeof(struct pool));                          bcopy(&pool, &mbpool, sizeof(pool));
                 else if (mclp < sizeof(mclpools) / sizeof(mclpools[0]) &&                  else if (mclp < sizeof(mclpools) / sizeof(mclpools[0]) &&
                     !strncmp(name, *mclnamep, strlen(*mclnamep))) {                      !strncmp(name, *mclnamep, strlen(*mclnamep))) {
                         bcopy(&pool, &mclpools[mclp++],                          bcopy(&pool, &mclpools[mclp++],
                             sizeof(struct pool));                              sizeof(pool));
                         mclnamep++;                          mclnamep++;
                 }                  }
         }          }

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32