Print this page
3946 ::gcore
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>


   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /* LINTLIBRARY */
  22 /* PROTOLIB1 */
  23 
  24 /*
  25  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */



  28 #include "libproc.h"
  29 
  30 /*
  31  * usr/src/lib/libproc
  32  */
  33 
  34 /* Pcontrol.c */
  35 int     _libproc_debug;
  36 struct ps_prochandle *Pcreate(const char *file, char *const *argv,
  37                 int *perr, char *path, size_t len);
  38 const char *Pcreate_error(int error);
  39 void    Pcreate_callback(struct ps_prochandle *Pr);
  40 struct ps_prochandle *Pgrab(pid_t pid, int gflag, int *perr);
  41 const char *Pgrab_error(int error);
  42 void    Pfree(struct ps_prochandle *Pr);
  43 int     Pstate(struct ps_prochandle *Pr);
  44 int     Pasfd(struct ps_prochandle *Pr);
  45 int     Pctlfd(struct ps_prochandle *Pr);
  46 const psinfo_t *Ppsinfo(struct ps_prochandle *Pr);
  47 const pstatus_t *Pstatus(struct ps_prochandle *Pr);
  48 int     Pcred(struct ps_prochandle *Pr, prcred_t *pcrp, int ngroups);
  49 ssize_t Ppriv(struct ps_prochandle *Pr, prpriv_t *pprivp, size_t);
  50 void    Psync(struct ps_prochandle *Pr);
  51 int     Pcreate_agent(struct ps_prochandle *Pr);
  52 void    Pdestroy_agent(struct ps_prochandle *Pr);
  53 int     Preopen(struct ps_prochandle *Pr);
  54 void    Prelease(struct ps_prochandle *Pr, int flags);
  55 int     Pstopstatus(struct ps_prochandle *Pr, long cmd, uint_t msec);
  56 int     Pwait(struct ps_prochandle *Pr, uint_t msec);
  57 int     Pstop(struct ps_prochandle *Pr, uint_t msec);
  58 int     Pdstop(struct ps_prochandle *Pr);
  59 int     Pgetareg(struct ps_prochandle *Pr, int regno, prgreg_t *preg);
  60 int     Pputareg(struct ps_prochandle *Pr, int regno, prgreg_t reg);
  61 int     Psetrun(struct ps_prochandle *Pr, int sig, int flags);
  62 ssize_t Pread(struct ps_prochandle *Pr,
  63                 void *buf, size_t nbyte, uintptr_t address);
  64 ssize_t Pread_string(struct ps_prochandle *Pr,
  65                 char *buf, size_t nbyte, uintptr_t address);
  66 ssize_t Pwrite(struct ps_prochandle *Pr,
  67                 const void *buf, size_t nbyte, uintptr_t address);
  68 int     Pclearsig(struct ps_prochandle *Pr);
  69 int     Pclearfault(struct ps_prochandle *Pr);




   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /* LINTLIBRARY */
  22 /* PROTOLIB1 */
  23 
  24 /*
  25  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 /*
  29  * Copyright (c) 2013 by Delphix. All rights reserved.
  30  */
  31 #include "libproc.h"
  32 
  33 /*
  34  * usr/src/lib/libproc
  35  */
  36 
  37 /* Pcontrol.c */
  38 int     _libproc_debug;
  39 struct ps_prochandle *Pcreate(const char *file, char *const *argv,
  40                 int *perr, char *path, size_t len);
  41 const char *Pcreate_error(int error);
  42 void    Pcreate_callback(struct ps_prochandle *Pr);
  43 struct ps_prochandle *Pgrab(pid_t pid, int gflag, int *perr);
  44 const char *Pgrab_error(int error);
  45 void    Pfree(struct ps_prochandle *Pr);
  46 int     Pstate(struct ps_prochandle *Pr);
  47 int     Pasfd(struct ps_prochandle *Pr);
  48 int     Pctlfd(struct ps_prochandle *Pr);
  49 const psinfo_t *Ppsinfo(struct ps_prochandle *Pr);
  50 const pstatus_t *Pstatus(struct ps_prochandle *Pr);
  51 int     Pcred(struct ps_prochandle *Pr, prcred_t *pcrp, int ngroups);
  52 int     Ppriv(struct ps_prochandle *Pr, prpriv_t **pprivp);
  53 void    Psync(struct ps_prochandle *Pr);
  54 int     Pcreate_agent(struct ps_prochandle *Pr);
  55 void    Pdestroy_agent(struct ps_prochandle *Pr);
  56 int     Preopen(struct ps_prochandle *Pr);
  57 void    Prelease(struct ps_prochandle *Pr, int flags);
  58 int     Pstopstatus(struct ps_prochandle *Pr, long cmd, uint_t msec);
  59 int     Pwait(struct ps_prochandle *Pr, uint_t msec);
  60 int     Pstop(struct ps_prochandle *Pr, uint_t msec);
  61 int     Pdstop(struct ps_prochandle *Pr);
  62 int     Pgetareg(struct ps_prochandle *Pr, int regno, prgreg_t *preg);
  63 int     Pputareg(struct ps_prochandle *Pr, int regno, prgreg_t reg);
  64 int     Psetrun(struct ps_prochandle *Pr, int sig, int flags);
  65 ssize_t Pread(struct ps_prochandle *Pr,
  66                 void *buf, size_t nbyte, uintptr_t address);
  67 ssize_t Pread_string(struct ps_prochandle *Pr,
  68                 char *buf, size_t nbyte, uintptr_t address);
  69 ssize_t Pwrite(struct ps_prochandle *Pr,
  70                 const void *buf, size_t nbyte, uintptr_t address);
  71 int     Pclearsig(struct ps_prochandle *Pr);
  72 int     Pclearfault(struct ps_prochandle *Pr);