llib-lproc revision 186f7fbf5e07d046b50e4e15c32b21f109b76c80
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/*
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * CDDL HEADER START
96e08422d46465ebd7105bf48e475f77e60250d7wrowe *
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * The contents of this file are subject to the terms of the
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * Common Development and Distribution License (the "License").
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * You may not use this file except in compliance with the License.
96e08422d46465ebd7105bf48e475f77e60250d7wrowe *
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * or http://www.opensolaris.org/os/licensing.
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * See the License for the specific language governing permissions
0662ed52e814f8f08ef0e09956413a792584eddffuankg * and limitations under the License.
96e08422d46465ebd7105bf48e475f77e60250d7wrowe *
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * When distributing Covered Code, include this CDDL HEADER in each
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * If applicable, add the following below this CDDL HEADER, with the
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * fields enclosed by brackets "[]" replaced with your own identifying
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * information: Portions Copyright [yyyy] [name of copyright owner]
96e08422d46465ebd7105bf48e475f77e60250d7wrowe *
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * CDDL HEADER END
96e08422d46465ebd7105bf48e475f77e60250d7wrowe */
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg/* LINTLIBRARY */
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg/* PROTOLIB1 */
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/*
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * Use is subject to license terms.
96e08422d46465ebd7105bf48e475f77e60250d7wrowe */
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#include "libproc.h"
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/*
96e08422d46465ebd7105bf48e475f77e60250d7wrowe * usr/src/lib/libproc
96e08422d46465ebd7105bf48e475f77e60250d7wrowe */
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* Pcontrol.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint _libproc_debug;
96e08422d46465ebd7105bf48e475f77e60250d7wrowestruct ps_prochandle *Pcreate(const char *file, char *const *argv,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int *perr, char *path, size_t len);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst char *Pcreate_error(int error);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Pcreate_callback(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowestruct ps_prochandle *Pgrab(pid_t pid, int gflag, int *perr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst char *Pgrab_error(int error);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Pfree(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pstate(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pasfd(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pctlfd(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst psinfo_t *Ppsinfo(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst pstatus_t *Pstatus(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pcred(struct ps_prochandle *Pr, prcred_t *pcrp, int ngroups);
96e08422d46465ebd7105bf48e475f77e60250d7wrowessize_t Ppriv(struct ps_prochandle *Pr, prpriv_t *pprivp, size_t);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Psync(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pcreate_agent(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Pdestroy_agent(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Preopen(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Prelease(struct ps_prochandle *Pr, int flags);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pstopstatus(struct ps_prochandle *Pr, long cmd, uint_t msec);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pwait(struct ps_prochandle *Pr, uint_t msec);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pstop(struct ps_prochandle *Pr, uint_t msec);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pdstop(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pgetareg(struct ps_prochandle *Pr, int regno, prgreg_t *preg);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pputareg(struct ps_prochandle *Pr, int regno, prgreg_t reg);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psetrun(struct ps_prochandle *Pr, int sig, int flags);
96e08422d46465ebd7105bf48e475f77e60250d7wrowessize_t Pread(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe void *buf, size_t nbyte, uintptr_t address);
96e08422d46465ebd7105bf48e475f77e60250d7wrowessize_t Pread_string(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe char *buf, size_t nbyte, uintptr_t address);
96e08422d46465ebd7105bf48e475f77e60250d7wrowessize_t Pwrite(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe const void *buf, size_t nbyte, uintptr_t address);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pclearsig(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pclearfault(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psetbkpt(struct ps_prochandle *Pr, uintptr_t address, ulong_t *saved);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pdelbkpt(struct ps_prochandle *Pr, uintptr_t address, ulong_t saved);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pxecbkpt(struct ps_prochandle *Pr, ulong_t saved);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psetwapt(struct ps_prochandle *Pr, const prwatch_t *wp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pdelwapt(struct ps_prochandle *Pr, const prwatch_t *wp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pxecwapt(struct ps_prochandle *Pr, const prwatch_t *wp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psetflags(struct ps_prochandle *Pr, long flags);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Punsetflags(struct ps_prochandle *Pr, long flags);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psignal(struct ps_prochandle *Pr, int which, int stop);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Psetsignal(struct ps_prochandle *Pr, const sigset_t *set);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pfault(struct ps_prochandle *Pr, int which, int stop);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Psetfault(struct ps_prochandle *Pr, const fltset_t *set);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psysentry(struct ps_prochandle *Pr, int which, int stop);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Psetsysentry(struct ps_prochandle *Pr, const sysset_t *set);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psysexit(struct ps_prochandle *Pr, int which, int stop);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Psetsysexit(struct ps_prochandle *Pr, const sysset_t *set);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_iter(struct ps_prochandle *Pr, proc_lwp_f *func, void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psyscall(struct ps_prochandle *Pr, sysret_t *,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int sysindex, uint_t nargs, argdes_t *argp);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowestruct ps_lwphandle *Lgrab(struct ps_prochandle *P, lwpid_t lwpid, int *perr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst char *Lgrab_error(int error);
96e08422d46465ebd7105bf48e475f77e60250d7wrowestruct ps_prochandle *Lprochandle(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Lfree(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lctlfd(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lwait(struct ps_lwphandle *Lwp, uint_t msec);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lstop(struct ps_lwphandle *Lwp, uint_t msec);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Ldstop(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lstate(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst lwpsinfo_t *Lpsinfo(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst lwpstatus_t *Lstatus(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lgetareg(struct ps_lwphandle *Lwp, int regno, prgreg_t *preg);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lputareg(struct ps_lwphandle *Lwp, int regno, prgreg_t reg);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lsetrun(struct ps_lwphandle *Lwp, int sig, int flags);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lclearsig(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lclearfault(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lxecbkpt(struct ps_lwphandle *Lwp, ulong_t saved);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Lxecwapt(struct ps_lwphandle *Lwp, const prwatch_t *wp);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Lsync(struct ps_lwphandle *Lwp);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* Plwpregs.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_getregs(struct ps_prochandle *Pr, lwpid_t i, prgregset_t gr);
0662ed52e814f8f08ef0e09956413a792584eddffuankgint Plwp_setregs(struct ps_prochandle *Pr, lwpid_t i, const prgregset_t gr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_getfpregs(struct ps_prochandle *Pr, lwpid_t i, prfpregset_t *fp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_setfpregs(struct ps_prochandle *Pr, lwpid_t i, const prfpregset_t *fp);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#if defined(sparc) || defined(__sparc)
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_getxregs(struct ps_prochandle *Pr, lwpid_t i, prxregset_t *xr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_setxregs(struct ps_prochandle *Pr, lwpid_t i, const prxregset_t *xr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#if defined(__sparcv9)
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_getasrs(struct ps_prochandle *Pr, lwpid_t i, asrset_t asrs);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_setasrs(struct ps_prochandle *Pr, lwpid_t i, const asrset_t asrs);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#endif /* __sparcv9 */
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#endif /* __sparc */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plwp_getpsinfo(struct ps_prochandle *Pr, lwpid_t i, lwpsinfo_t *lps);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
0662ed52e814f8f08ef0e09956413a792584eddffuankg/* Pcore.c */
96e08422d46465ebd7105bf48e475f77e60250d7wrowestruct ps_prochandle *Pfgrab_core(int fd, const char *aout, int *perr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowestruct ps_prochandle *Pgrab_core(const char *core, const char *aout,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int gflag, int *perr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
0662ed52e814f8f08ef0e09956413a792584eddffuankg/* Pisprocdir.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pisprocdir(struct ps_prochandle *Pr, const char *dir);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* Pservice.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pdmodel(struct ps_prochandle *Pr, int *modelp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pread(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe psaddr_t addr, void *buf, size_t size);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pwrite(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe psaddr_t addr, const void *buf, size_t size);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pdread(struct ps_prochandle *Pr,
0662ed52e814f8f08ef0e09956413a792584eddffuankg psaddr_t addr, void *buf, size_t size);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pdwrite(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe psaddr_t addr, const void *buf, size_t size);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_ptread(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe psaddr_t addr, void *buf, size_t size);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_ptwrite(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe psaddr_t addr, const void *buf, size_t size);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pstop(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pcontinue(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lstop(struct ps_prochandle *Pr, lwpid_t lwpid);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lcontinue(struct ps_prochandle *Pr, lwpid_t lwpid);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lgetregs(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, prgregset_t regs);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lsetregs(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, const prgregset_t regs);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lgetfpregs(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, prfpregset_t *regs);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lsetfpregs(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, const prfpregset_t *regs);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#if defined(sparc) || defined(__sparc)
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lgetxregsize(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, int *xrsize);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lgetxregs(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, caddr_t xregs);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lsetxregs(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, caddr_t xregs);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#endif /* sparc */
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#if defined(__i386) || defined(__amd64)
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_lgetLDT(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe lwpid_t lwpid, struct ssd *ldt);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe#endif /* __i386 || __amd6464 */
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid ps_plog(const char *fmt, ...);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* Psymtab.c */
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Pupdate_maps(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Pupdate_syms(struct ps_prochandle *Pr);
cf7ca2f9eaa6523fefcccba4287b91637391fb51fuankgrd_agent_t *Prd_agent(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst prmap_t *Paddr_to_map(struct ps_prochandle *Pr, uintptr_t addr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst prmap_t *Paddr_to_text_map(struct ps_prochandle *Pr, uintptr_t addr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst prmap_t *Pname_to_map(struct ps_prochandle *Pr, const char *name);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst prmap_t *Plmid_to_map(struct ps_prochandle *Pr, Lmid_t lmid,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe const char *name);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plookup_by_addr(struct ps_prochandle *Pr, uintptr_t addr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe char *sym_name_buffer, size_t bufsize, GElf_Sym *symbolp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plookup_by_name(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe const char *object_name, const char *symbol_name,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe GElf_Sym *sym);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plookup_by_lmid(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe Lmid_t lmid, const char *object_name, const char *symbol_name,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe GElf_Sym *sym);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst rd_loadobj_t *Paddr_to_loadobj(struct ps_prochandle *, uintptr_t);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst rd_loadobj_t *Pname_to_loadobj(struct ps_prochandle *, const char *);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst rd_loadobj_t *Plmid_to_loadobj(struct ps_prochandle *, Lmid_t,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe const char *);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pmapping_iter(struct ps_prochandle *Pr, proc_map_f *func, void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pmapping_iter_resolved(struct ps_prochandle *Pr, proc_map_f *func,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pobject_iter(struct ps_prochandle *Pr, proc_map_f *func, void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Pobject_iter_resolved(struct ps_prochandle *Pr, proc_map_f *func,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pobjname(struct ps_prochandle *Pr, uintptr_t addr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe char *buffer, size_t bufsize);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pobjname_resolved(struct ps_prochandle *Pr, uintptr_t addr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe char *buffer, size_t bufsize);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Plmid(struct ps_prochandle *Pr, uintptr_t addr, Lmid_t *lmidp);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psymbol_iter(struct ps_prochandle *Pr, const char *object_name,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int which, int type, proc_sym_f *func, void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Psymbol_iter_by_lmid(struct ps_prochandle *Pr, Lmid_t lmid,
8ffac2c334103c0336602aaede650cb578611151fuankg const char *object_name, int which, int type,
8ffac2c334103c0336602aaede650cb578611151fuankg proc_sym_f *func, void *cd);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pgetenv(struct ps_prochandle *Pr, const char *name,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe char *buffer, size_t bufsize);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pplatform(struct ps_prochandle *Pr, char *s, size_t n);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint Puname(struct ps_prochandle *Pr, struct utsname *u);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pzonename(struct ps_prochandle *Pr, char *s, size_t n);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pfindobj(struct ps_prochandle *Pr, const char *path,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe char *s, size_t n);
96e08422d46465ebd7105bf48e475f77e60250d7wrowechar *Pexecname(struct ps_prochandle *Pr, char *buffer, size_t bufsize);
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Preset_maps(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pglobal_lookup(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe const char *object_name, const char *sym_name,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe psaddr_t *sym_addr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pglobal_sym(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe const char *object_name, const char *sym_name,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe ps_sym_t *symp);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowelong Pgetauxval(struct ps_prochandle *Pr, int type);
96e08422d46465ebd7105bf48e475f77e60250d7wroweconst auxv_t *Pgetauxvec(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wroweps_err_e ps_pauxv(struct ps_prochandle *Pr, const auxv_t **aux);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* Putil.c */
96e08422d46465ebd7105bf48e475f77e60250d7wrowevoid Perror_printf(struct ps_prochandle *Pr, const char *format, ...);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* pr_door.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_door_info(struct ps_prochandle *Pr, int did, door_info_t *di);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* pr_exit.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_exit(struct ps_prochandle *Pr, int status);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_lwp_exit(struct ps_prochandle *Pr);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* pr_fcntl.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_fcntl(struct ps_prochandle *Pr, int fd, int cmd, void *argp);
0662ed52e814f8f08ef0e09956413a792584eddffuankg
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* pr_getitimer.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_getitimer(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int which, struct itimerval *itv);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_setitimer(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int which, const struct itimerval *itv, struct itimerval *oitv);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
96e08422d46465ebd7105bf48e475f77e60250d7wrowe/* pr_getrctl.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_getrctl(struct ps_prochandle *Pr, const char *rname,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe rctlblk_t *old_blk, rctlblk_t *new_blk, int rflag);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_setrctl(struct ps_prochandle *Pr, const char *rname,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe rctlblk_t *old_blk, rctlblk_t *new_blk, int rflag);
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_setprojrctl(struct ps_prochandle *Pr, const char *rname,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe rctlblk_t *new_blk, size_t size, int rflag);
96e08422d46465ebd7105bf48e475f77e60250d7wrowe
0662ed52e814f8f08ef0e09956413a792584eddffuankg/* pr_getrlimit.c */
96e08422d46465ebd7105bf48e475f77e60250d7wroweint pr_getrlimit(struct ps_prochandle *Pr,
96e08422d46465ebd7105bf48e475f77e60250d7wrowe int resource, struct rlimit *rlp);
int pr_setrlimit(struct ps_prochandle *Pr,
int resource, const struct rlimit *rlp);
int pr_getrlimit64(struct ps_prochandle *Pr,
int resource, struct rlimit64 *rlp);
int pr_setrlimit64(struct ps_prochandle *Pr,
int resource, const struct rlimit64 *rlp);
/* pr_getsockname.c */
int pr_getsockname(struct ps_prochandle *Pr,
int sock, struct sockaddr *name, socklen_t *namelen);
int pr_getpeername(struct ps_prochandle *Pr,
int sock, struct sockaddr *name, socklen_t *namelen);
/* pr_ioctl.c */
int pr_ioctl(struct ps_prochandle *Pr,
int fd, int code, void *buf, size_t size);
/* pr_lseek.c */
off_t pr_lseek(struct ps_prochandle *Pr,
int filedes, off_t offset, int whence);
offset_t pr_llseek(struct ps_prochandle *Pr,
int filedes, offset_t offset, int whence);
/* pr_memcntl.c */
int pr_memcntl(struct ps_prochandle *Pr,
caddr_t addr, size_t len, int cmd, caddr_t arg, int attr, int mask);
/* pr_mmap.c */
void *pr_mmap(struct ps_prochandle *Pr,
void *addr, size_t len, int prot, int flags, int fd, off_t off);
int pr_munmap(struct ps_prochandle *Pr,
void *addr, size_t len);
void *pr_zmap(struct ps_prochandle *Pr,
void *addr, size_t len, int prot, int flags);
/* pr_open.c */
int pr_open(struct ps_prochandle *Pr,
const char *filename, int flags, mode_t mode);
int pr_creat(struct ps_prochandle *Pr,
const char *filename, mode_t mode);
int pr_close(struct ps_prochandle *Pr, int fd);
int pr_access(struct ps_prochandle *Pr, const char *path, int amode);
/* pr_pbind.c */
int pr_processor_bind(struct ps_prochandle *Pr, idtype_t, id_t, int, int *);
int pr_pset_bind(struct ps_prochandle *Pr, int, idtype_t, id_t, int *);
/* pr_rename.c */
int pr_rename(struct ps_prochandle *Pr, const char *old, const char *new);
int pr_link(struct ps_prochandle *Pr, const char *exist, const char *new);
int pr_unlink(struct ps_prochandle *Pr, const char *);
/* pr_sigaction.c */
int pr_sigaction(struct ps_prochandle *Pr,
int sig, const struct sigaction *act, struct sigaction *oact);
/* pr_stat.c */
int pr_stat(struct ps_prochandle *Pr, const char *path, struct stat *buf);
int pr_lstat(struct ps_prochandle *Pr, const char *path, struct stat *buf);
int pr_fstat(struct ps_prochandle *Pr, int fd, struct stat *buf);
int pr_stat64(struct ps_prochandle *Pr, const char *path,
struct stat64 *buf);
int pr_lstat64(struct ps_prochandle *Pr, const char *path,
struct stat64 *buf);
int pr_fstat64(struct ps_prochandle *Pr, int fd, struct stat64 *buf);
/* pr_statvfs.c */
int pr_statvfs(struct ps_prochandle *Pr, const char *path, statvfs_t *buf);
int pr_fstatvfs(struct ps_prochandle *Pr, int fd, statvfs_t *buf);
/* pr_tasksys.c */
projid_t pr_getprojid(struct ps_prochandle *Pr);
taskid_t pr_gettaskid(struct ps_prochandle *Pr);
taskid_t pr_settaskid(struct ps_prochandle *Pr, projid_t project, int flags);
/* pr_waitid.c */
int pr_waitid(struct ps_prochandle *Pr,
idtype_t idtype, id_t id, siginfo_t *infop, int options);
/* proc_get_info.c */
int proc_get_cred(pid_t pid, prcred_t *credp, int ngroups);
prpriv_t *proc_get_priv(pid_t pid);
int proc_get_psinfo(pid_t pid, psinfo_t *psp);
int proc_get_status(pid_t pid, pstatus_t *psp);
int proc_get_auxv(pid_t pid, auxv_t *pauxv, int naux);
/* proc_names.c */
char *proc_fltname(int flt, char *buf, size_t bufsz);
char *proc_signame(int sig, char *buf, size_t bufsz);
char *proc_sysname(int sys, char *buf, size_t bufsz);
int proc_str2flt(const char *str, int *fltnum);
int proc_str2sig(const char *str, int *signum);
int proc_str2sys(const char *str, int *sysnum);
char *proc_fltset2str(const fltset_t *set, const char *delim, int members,
char *buf, size_t nbytes);
char *proc_sigset2str(const sigset_t *set, const char *delim, int members,
char *buf, size_t nbytes);
char *proc_sysset2str(const sysset_t *set, const char *delim, int members,
char *buf, size_t nbytes);
char *proc_str2fltset(const char *str, const char *delim, int members,
fltset_t *set);
char *proc_str2sigset(const char *str, const char *delim, int members,
sigset_t *set);
char *proc_str2sysset(const char *str, const char *delim, int members,
sysset_t *set);
int proc_walk(proc_walk_f *func, void *arg, int flags);
/* proc_arg.c */
struct ps_prochandle *proc_arg_grab(const char *arg,
int oflag, int gflag, int *perr);
pid_t proc_arg_psinfo(const char *arg, int oflag, psinfo_t *psp, int *perr);
void proc_unctrl_psinfo(psinfo_t *psp);
/* proc_set.c */
int Psetcred(struct ps_prochandle *Pr, const prcred_t *pcred);
/* Pstack.c */
int Pstack_iter(struct ps_prochandle *Pr,
const prgregset_t regs, proc_stack_f *func, void *arg);
/* Pisadep.c */
const char *Ppltdest(struct ps_prochandle *Pr, uintptr_t addr);