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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/proc/prdata.h
          +++ new/usr/src/uts/common/fs/proc/prdata.h
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21  /*
  22   22   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   27  /*        All Rights Reserved   */
  28   28  
  29   29  /*
  30   30   * Copyright 2018 Joyent, Inc.
       31 + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  31   32   */
  32   33  
  33   34  #ifndef _SYS_PROC_PRDATA_H
  34   35  #define _SYS_PROC_PRDATA_H
  35   36  
  36   37  #include <sys/isa_defs.h>
  37   38  #include <sys/proc.h>
  38   39  #include <sys/vnode.h>
  39   40  #include <sys/prsystm.h>
  40   41  #include <sys/model.h>
↓ open down ↓ 83 lines elided ↑ open up ↑
 124  125          PR_LDT,                 /* /proc/<pid>/ldt                      */
 125  126  #endif
 126  127          PR_USAGE,               /* /proc/<pid>/usage                    */
 127  128          PR_LUSAGE,              /* /proc/<pid>/lusage                   */
 128  129          PR_PAGEDATA,            /* /proc/<pid>/pagedata                 */
 129  130          PR_WATCH,               /* /proc/<pid>/watch                    */
 130  131          PR_CURDIR,              /* /proc/<pid>/cwd                      */
 131  132          PR_ROOTDIR,             /* /proc/<pid>/root                     */
 132  133          PR_FDDIR,               /* /proc/<pid>/fd                       */
 133  134          PR_FD,                  /* /proc/<pid>/fd/nn                    */
      135 +        PR_FDINFODIR,           /* /proc/<pid>/fdinfo                   */
      136 +        PR_FDINFO,              /* /proc/<pid>/fdinfo/nn                */
 134  137          PR_OBJECTDIR,           /* /proc/<pid>/object                   */
 135  138          PR_OBJECT,              /* /proc/<pid>/object/xxx               */
 136  139          PR_LWPDIR,              /* /proc/<pid>/lwp                      */
 137  140          PR_LWPIDDIR,            /* /proc/<pid>/lwp/<lwpid>              */
 138  141          PR_LWPCTL,              /* /proc/<pid>/lwp/<lwpid>/lwpctl       */
 139  142          PR_LWPNAME,             /* /proc/<pid>/lwp/<lwpid>/lwpname      */
 140  143          PR_LWPSTATUS,           /* /proc/<pid>/lwp/<lwpid>/lwpstatus    */
 141  144          PR_LWPSINFO,            /* /proc/<pid>/lwp/<lwpid>/lwpsinfo     */
 142  145          PR_LWPUSAGE,            /* /proc/<pid>/lwp/<lwpid>/lwpusage     */
 143  146          PR_XREGS,               /* /proc/<pid>/lwp/<lwpid>/xregs        */
↓ open down ↓ 137 lines elided ↑ open up ↑
 281  284   *
 282  285   * The implementation is opaque.
 283  286   *
 284  287   * A user of this will perform the following steps:
 285  288   *
 286  289   *      list_t  listhead;
 287  290   *      struct my *mp;
 288  291   *
 289  292   *      pr_iol_initlist(&listhead, sizeof (*mp), n);
 290  293   *      while (whatever) {
 291      - *              mp = pr_iol_newbuf(&listhead, sizeof (*mp);
      294 + *              mp = pr_iol_newbuf(&listhead, sizeof (*mp));
 292  295   *              ...
 293  296   *              error = ...
 294  297   *      }
 295  298   *
 296  299   * When done, depending on whether copyout() or uiomove() is supposed to
 297  300   * be used for transferring the buffered data to userspace, call either:
 298  301   *
 299  302   *      error = pr_iol_copyout_and_free(&listhead, &cmaddr, error);
 300  303   *
 301  304   * or else:
↓ open down ↓ 4 lines elided ↑ open up ↑
 306  309   * if an error occurred before they will not perform the copyout/uiomove.
 307  310   * If copyout/uiomove are done, the passed target address / uio_t
 308  311   * are updated. The error returned will either be the one passed in, or
 309  312   * the error that occurred during copyout/uiomove.
 310  313   */
 311  314  
 312  315  extern  void    pr_iol_initlist(list_t *head, size_t itemsize, int nitems);
 313  316  extern  void *  pr_iol_newbuf(list_t *head, size_t itemsize);
 314  317  extern  int     pr_iol_copyout_and_free(list_t *head, caddr_t *tgt, int errin);
 315  318  extern  int     pr_iol_uiomove_and_free(list_t *head, uio_t *uiop, int errin);
      319 +extern  void    pr_iol_freelist(list_t *);
 316  320  
 317  321  #if defined(_SYSCALL32_IMPL)
 318  322  
 319  323  extern  int     prwritectl32(vnode_t *, struct uio *, cred_t *);
 320  324  extern  void    prgetaction32(proc_t *, user_t *, uint_t, struct sigaction32 *);
 321  325  extern  void    prcvtusage32(struct prhusage *, prusage32_t *);
 322  326  
 323  327  #endif  /* _SYSCALL32_IMPL */
 324  328  
 325  329  /* kludge to support old /proc interface */
↓ open down ↓ 14 lines elided ↑ open up ↑
 340  344  extern  int     pr_wait(prcommon_t *, timestruc_t *, int);
 341  345  extern  void    pr_wait_die(prnode_t *);
 342  346  extern  int     pr_setsig(prnode_t *, siginfo_t *);
 343  347  extern  int     pr_kill(prnode_t *, int, cred_t *);
 344  348  extern  int     pr_unkill(prnode_t *, int);
 345  349  extern  int     pr_nice(proc_t *, int, cred_t *);
 346  350  extern  void    pr_setentryexit(proc_t *, sysset_t *, int);
 347  351  extern  int     pr_set(proc_t *, long);
 348  352  extern  int     pr_unset(proc_t *, long);
 349  353  extern  void    pr_sethold(prnode_t *, sigset_t *);
      354 +extern  file_t  *pr_getf(proc_t *, uint_t, short *);
      355 +extern  void    pr_releasef(proc_t *, uint_t);
 350  356  extern  void    pr_setfault(proc_t *, fltset_t *);
 351  357  extern  int     prusrio(proc_t *, enum uio_rw, struct uio *, int);
 352  358  extern  int     prwritectl(vnode_t *, struct uio *, cred_t *);
 353  359  extern  int     prlock(prnode_t *, int);
 354  360  extern  void    prunmark(proc_t *);
 355  361  extern  void    prunlock(prnode_t *);
 356  362  extern  size_t  prpdsize(struct as *);
 357  363  extern  int     prpdread(proc_t *, uint_t, struct uio *);
 358  364  extern  size_t  oprpdsize(struct as *);
 359  365  extern  int     oprpdread(struct as *, uint_t, struct uio *);
↓ open down ↓ 59 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX