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

Diff for /src/usr.bin/fstat/fstat.c between version 1.75 and 1.76

version 1.75, 2013/03/31 01:42:28 version 1.76, 2013/10/22 16:40:27
Line 102 
Line 102 
 kvm_t *kd;  kvm_t *kd;
 uid_t uid;  uid_t uid;
   
 void fstat_dofile(struct kinfo_file2 *);  void fstat_dofile(struct kinfo_file *);
 void fstat_header(void);  void fstat_header(void);
 void getinetproto(int);  void getinetproto(int);
 void usage(void);  void usage(void);
 int getfname(char *);  int getfname(char *);
 void cryptotrans(struct kinfo_file2 *);  void cryptotrans(struct kinfo_file *);
 void kqueuetrans(struct kinfo_file2 *);  void kqueuetrans(struct kinfo_file *);
 void pipetrans(struct kinfo_file2 *);  void pipetrans(struct kinfo_file *);
 struct kinfo_file2 *splice_find(char, u_int64_t);  struct kinfo_file *splice_find(char, u_int64_t);
 void splice_insert(char, u_int64_t, struct kinfo_file2 *);  void splice_insert(char, u_int64_t, struct kinfo_file *);
 void find_splices(struct kinfo_file2 *, int);  void find_splices(struct kinfo_file *, int);
 void print_inet_details(struct kinfo_file2 *);  void print_inet_details(struct kinfo_file *);
 #ifdef INET6  #ifdef INET6
 void print_inet6_details(struct kinfo_file2 *);  void print_inet6_details(struct kinfo_file *);
 #endif  #endif
 void print_sock_details(struct kinfo_file2 *);  void print_sock_details(struct kinfo_file *);
 void socktrans(struct kinfo_file2 *);  void socktrans(struct kinfo_file *);
 void systracetrans(struct kinfo_file2 *);  void systracetrans(struct kinfo_file *);
 void vtrans(struct kinfo_file2 *);  void vtrans(struct kinfo_file *);
 const char *inet6_addrstr(struct in6_addr *);  const char *inet6_addrstr(struct in6_addr *);
 int signame_to_signum(char *);  int signame_to_signum(char *);
 void hide(void *p);  void hide(void *p);
Line 137 
Line 137 
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         struct passwd *passwd;          struct passwd *passwd;
         struct kinfo_file2 *kf, *kflast;          struct kinfo_file *kf, *kflast;
         int arg, ch, what;          int arg, ch, what;
         char *memf, *nlistf, *optstr;          char *memf, *nlistf, *optstr;
         char buf[_POSIX2_LINE_MAX];          char buf[_POSIX2_LINE_MAX];
Line 271 
Line 271 
                 checkfile = 1;                  checkfile = 1;
         }          }
   
         if ((kf = kvm_getfile2(kd, what, arg, sizeof(*kf), &cnt)) == NULL)          if ((kf = kvm_getfiles(kd, what, arg, sizeof(*kf), &cnt)) == NULL)
                 errx(1, "%s", kvm_geterr(kd));                  errx(1, "%s", kvm_geterr(kd));
   
         find_splices(kf, cnt);          find_splices(kf, cnt);
Line 336 
Line 336 
  * print open files attributed to this process   * print open files attributed to this process
  */   */
 void  void
 fstat_dofile(struct kinfo_file2 *kf)  fstat_dofile(struct kinfo_file *kf)
 {  {
   
         Uname = user_from_uid(kf->p_uid, 0);          Uname = user_from_uid(kf->p_uid, 0);
Line 378 
Line 378 
 }  }
   
 void  void
 vtrans(struct kinfo_file2 *kf)  vtrans(struct kinfo_file *kf)
 {  {
         const char *badtype = NULL;          const char *badtype = NULL;
         char rw[3], mode[12];          char rw[3], mode[12];
Line 471 
Line 471 
 }  }
   
 void  void
 pipetrans(struct kinfo_file2 *kf)  pipetrans(struct kinfo_file *kf)
 {  {
         void *maxaddr;          void *maxaddr;
   
Line 502 
Line 502 
 }  }
   
 void  void
 kqueuetrans(struct kinfo_file2 *kf)  kqueuetrans(struct kinfo_file *kf)
 {  {
         PREFIX(kf->fd_fd);          PREFIX(kf->fd_fd);
   
Line 518 
Line 518 
 }  }
   
 void  void
 cryptotrans(struct kinfo_file2 *kf)  cryptotrans(struct kinfo_file *kf)
 {  {
         PREFIX(kf->fd_fd);          PREFIX(kf->fd_fd);
   
Line 530 
Line 530 
 }  }
   
 void  void
 systracetrans(struct kinfo_file2 *kf)  systracetrans(struct kinfo_file *kf)
 {  {
         PREFIX(kf->fd_fd);          PREFIX(kf->fd_fd);
   
Line 570 
Line 570 
 #endif  #endif
   
 void  void
 splice_insert(char type, u_int64_t ptr, struct kinfo_file2 *data)  splice_insert(char type, u_int64_t ptr, struct kinfo_file *data)
 {  {
         ENTRY entry, *found;          ENTRY entry, *found;
   
Line 584 
Line 584 
                 found->data = NULL;                  found->data = NULL;
 }  }
   
 struct kinfo_file2 *  struct kinfo_file *
 splice_find(char type, u_int64_t ptr)  splice_find(char type, u_int64_t ptr)
 {  {
         ENTRY entry, *found;          ENTRY entry, *found;
Line 597 
Line 597 
 }  }
   
 void  void
 find_splices(struct kinfo_file2 *kf, int cnt)  find_splices(struct kinfo_file *kf, int cnt)
 {  {
         int i, created;          int i, created;
   
Line 617 
Line 617 
 }  }
   
 void  void
 print_inet_details(struct kinfo_file2 *kf)  print_inet_details(struct kinfo_file *kf)
 {  {
         struct in_addr laddr, faddr;          struct in_addr laddr, faddr;
   
Line 653 
Line 653 
   
 #ifdef INET6  #ifdef INET6
 void  void
 print_inet6_details(struct kinfo_file2 *kf)  print_inet6_details(struct kinfo_file *kf)
 {  {
         char xaddrbuf[NI_MAXHOST + 2];          char xaddrbuf[NI_MAXHOST + 2];
         struct in6_addr laddr6, faddr6;          struct in6_addr laddr6, faddr6;
Line 700 
Line 700 
 #endif  #endif
   
 void  void
 print_sock_details(struct kinfo_file2 *kf)  print_sock_details(struct kinfo_file *kf)
 {  {
         if (kf->so_family == AF_INET)          if (kf->so_family == AF_INET)
                 print_inet_details(kf);                  print_inet_details(kf);
Line 711 
Line 711 
 }  }
   
 void  void
 socktrans(struct kinfo_file2 *kf)  socktrans(struct kinfo_file *kf)
 {  {
         static char *stypename[] = {          static char *stypename[] = {
                 "unused",       /* 0 */                  "unused",       /* 0 */
Line 809 
Line 809 
                 hide((void *)(uintptr_t)kf->f_data);                  hide((void *)(uintptr_t)kf->f_data);
         }          }
         if (kf->so_splice != 0 || kf->so_splicelen == -1) {          if (kf->so_splice != 0 || kf->so_splicelen == -1) {
                 struct kinfo_file2 *from, *to;                  struct kinfo_file *from, *to;
   
                 from = splice_find('<', kf->f_data);                  from = splice_find('<', kf->f_data);
                 to = NULL;                  to = NULL;

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76