172494a10Schristos /* 272494a10Schristos * Copyright (c) 2010 The FreeBSD Foundation 372494a10Schristos * All rights reserved. 472494a10Schristos * 572494a10Schristos * This software was developed by Rui Paulo under sponsorship from the 672494a10Schristos * FreeBSD Foundation. 772494a10Schristos * 872494a10Schristos * Redistribution and use in source and binary forms, with or without 972494a10Schristos * modification, are permitted provided that the following conditions 1072494a10Schristos * are met: 1172494a10Schristos * 1. Redistributions of source code must retain the above copyright 1272494a10Schristos * notice, this list of conditions and the following disclaimer. 1372494a10Schristos * 2. Redistributions in binary form must reproduce the above copyright 1472494a10Schristos * notice, this list of conditions and the following disclaimer in the 1572494a10Schristos * documentation and/or other materials provided with the distribution. 1672494a10Schristos * 1772494a10Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1872494a10Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1972494a10Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2072494a10Schristos * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2172494a10Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2272494a10Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2372494a10Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2472494a10Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2572494a10Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2672494a10Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2772494a10Schristos * SUCH DAMAGE. 2872494a10Schristos * 29*ba2539a9Schs * $FreeBSD: head/cddl/lib/libdtrace/libproc_compat.h 309597 2016-12-06 04:22:38Z markj $ 3072494a10Schristos */ 3172494a10Schristos 3272494a10Schristos /* 3372494a10Schristos * Compatibility functions between Solaris libproc and FreeBSD libproc. 3472494a10Schristos * Functions sorted alphabetically. 3572494a10Schristos */ 3672494a10Schristos #define PR_LMID_EVERY 0 37*ba2539a9Schs #define PGRAB_RDONLY PATTACH_RDONLY 38*ba2539a9Schs #define PGRAB_FORCE PATTACH_FORCE 39*ba2539a9Schs 4072494a10Schristos #define Psetrun(p, a1, a2) proc_continue((p)) 4172494a10Schristos #define Pxlookup_by_addr(p, a, n, s, sym, i) \ 4272494a10Schristos proc_addr2sym(p, a, n, s, sym) 4372494a10Schristos #define Pxlookup_by_name(p, l, s1, s2, sym, a) \ 4472494a10Schristos proc_name2sym(p, s1, s2, sym, a) 4572494a10Schristos #define Paddr_to_map proc_addr2map 4672494a10Schristos #define Pcreate_error strerror 4772494a10Schristos #define Pdelbkpt proc_bkptdel 4872494a10Schristos #define Pgrab_error strerror 4972494a10Schristos #define Plmid(p, a, l) (-1) 5072494a10Schristos #define Plmid_to_map(p, l, o) proc_obj2map((p), (o)) 5172494a10Schristos #define Plookup_by_addr proc_addr2sym 5272494a10Schristos #define Pname_to_ctf(p, obj) (ctf_file_t *)proc_name2ctf(p, obj) 5372494a10Schristos #define Pname_to_map proc_name2map 5472494a10Schristos #define Pobject_iter proc_iter_objs 5572494a10Schristos #define Pobject_iter_resolved(p, f, arg) proc_iter_objs(p, f, arg) 5672494a10Schristos #define Pobjname proc_objname 5772494a10Schristos #define Pread proc_read 5872494a10Schristos #define Prd_agent proc_rdagent 5972494a10Schristos #define Prelease proc_detach 6072494a10Schristos #define Psetbkpt proc_bkptset 6172494a10Schristos #define Psetflags proc_setflags 6272494a10Schristos #define Pstate proc_state 6372494a10Schristos #define Psymbol_iter_by_addr proc_iter_symbyaddr 6472494a10Schristos #define Punsetflags proc_clearflags 6572494a10Schristos #define Pupdate_maps proc_rdagent 6672494a10Schristos #define Pupdate_syms proc_updatesyms 6772494a10Schristos #define Pxecbkpt proc_bkptexec 68