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

Diff for /src/usr.bin/tcpbench/tcpbench.c between version 1.56 and 1.57

version 1.56, 2018/05/22 18:56:33 version 1.57, 2018/08/08 14:35:38
Line 49 
Line 49 
 #include <err.h>  #include <err.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <poll.h>  #include <poll.h>
   #include <paths.h>
   
 #include <kvm.h>  #include <kvm.h>
 #include <nlist.h>  #include <nlist.h>
Line 1123 
Line 1124 
                 }                  }
         }          }
   
         if (pledge("stdio rpath dns inet unix id proc", NULL) == -1)          if (pledge("stdio unveil rpath dns inet unix id proc", NULL) == -1)
                 err(1, "pledge");                  err(1, "pledge");
   
         argv += optind;          argv += optind;
Line 1133 
Line 1134 
                 usage();                  usage();
   
         if (ptb->kvars) {          if (ptb->kvars) {
                   if (unveil(_PATH_MEM, "r") == -1)
                           err(1, "unveil");
                   if (unveil(_PATH_KMEM, "r") == -1)
                           err(1, "unveil");
                   if (unveil(_PATH_KSYMS, "r") == -1)
                           err(1, "unveil");
   
                 if ((ptb->kvmh = kvm_openfiles(NULL, NULL, NULL,                  if ((ptb->kvmh = kvm_openfiles(NULL, NULL, NULL,
                     O_RDONLY, kerr)) == NULL)                      O_RDONLY, kerr)) == NULL)
                         errx(1, "kvm_open: %s", kerr);                          errx(1, "kvm_open: %s", kerr);
Line 1143 
Line 1151 
         } else          } else
                 drop_gid();                  drop_gid();
   
           if (!ptb->sflag || ptb->Uflag)
                   host = argv[0];
   
           if (ptb->Uflag)
                   if (unveil(host, "rwc") == -1)
                           err(1, "unveil");
   
         if (pledge("stdio id dns inet unix", NULL) == -1)          if (pledge("stdio id dns inet unix", NULL) == -1)
                 err(1, "pledge");                  err(1, "pledge");
   
         if (!ptb->sflag || ptb->Uflag)  
                 host = argv[0];  
         /*          /*
          * Rationale,           * Rationale,
          * If TCP, use a big buffer with big reads/writes.           * If TCP, use a big buffer with big reads/writes.

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57