Print this page
12046 Provide /proc/<PID>/fdinfo/

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/exec/elf/elf_notes.c
          +++ new/usr/src/uts/common/exec/elf/elf_notes.c
↓ open down ↓ 100 lines elided ↑ open up ↑
 101  101              + roundup(priv_get_implinfo_size(), sizeof (Word))
 102  102              + roundup(strlen(platform) + 1, sizeof (Word))
 103  103              + roundup(strlen(p->p_zone->zone_name) + 1, sizeof (Word))
 104  104              + roundup(__KERN_NAUXV_IMPL * sizeof (aux_entry_t), sizeof (Word))
 105  105              + roundup(sizeof (utsname), sizeof (Word))
 106  106              + roundup(sizeof (core_content_t), sizeof (Word))
 107  107              + roundup(sizeof (prsecflags_t), sizeof (Word))
 108  108              + (nlwp + nzomb) * roundup(sizeof (lwpsinfo_t), sizeof (Word))
 109  109              + nlwp * roundup(sizeof (lwpstatus_t), sizeof (Word))
 110  110              + nlwp * roundup(sizeof (prlwpname_t), sizeof (Word))
 111      -            + nfd * roundup(sizeof (prfdinfo_t), sizeof (Word));
      111 +            + nfd * roundup(sizeof (prfdinfov1_t), sizeof (Word));
 112  112  
 113  113          if (curproc->p_agenttp != NULL) {
 114  114                  v[0].p_filesz += sizeof (Note) +
 115  115                      roundup(sizeof (psinfo_t), sizeof (Word));
 116  116          }
 117  117  
 118  118          size = sizeof (prcred_t) + sizeof (gid_t) * (ngroups_max - 1);
 119  119          pcrp = kmem_alloc(size, KM_SLEEP);
 120  120          prgetcred(p, pcrp);
 121  121          if (pcrp->pr_ngroups != 0) {
↓ open down ↓ 221 lines elided ↑ open up ↑
 343  343  
 344  344          VN_HOLD(vroot);
 345  345  
 346  346          fip = P_FINFO(p);
 347  347  
 348  348          for (fd = 0; fd < fip->fi_nfiles; fd++) {
 349  349                  uf_entry_t *ufp;
 350  350                  vnode_t *fvp;
 351  351                  struct file *fp;
 352  352                  vattr_t vattr;
 353      -                prfdinfo_t fdinfo;
      353 +                prfdinfov1_t fdinfo;
 354  354  
 355  355                  bzero(&fdinfo, sizeof (fdinfo));
 356  356  
 357  357                  mutex_enter(&fip->fi_lock);
 358  358                  UF_ENTER(ufp, fip, fd);
 359  359                  if (((fp = ufp->uf_file) == NULL) || (fp->f_count < 1)) {
 360  360                          UF_EXIT(ufp);
 361  361                          mutex_exit(&fip->fi_lock);
 362  362                          continue;
 363  363                  }
↓ open down ↓ 239 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX