summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
diff options
context:
space:
mode:
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common/drti.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/drti.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
index b2854d2..1ee873b 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
@@ -56,13 +56,13 @@
*/
static const char *devnamep = "/dev/dtrace/helper";
-#if defined(sun)
+#ifdef illumos
static const char *olddevname = "/devices/pseudo/dtrace@0:helper";
#endif
static const char *modname; /* Name of this load object */
static int gen; /* DOF helper generation */
-#if defined(sun)
+#ifdef illumos
extern dof_hdr_t __SUNW_dof; /* DOF defined in the .SUNW_dof section */
#endif
static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */
@@ -90,7 +90,7 @@ dprintf(int debug, const char *fmt, ...)
va_end(ap);
}
-#if !defined(sun)
+#ifndef illumos
static void
fixsymbol(Elf *e, Elf_Data *data, size_t idx, int nprobes, char *buf,
dof_sec_t *sec, int *fixedprobes, char *dofstrtab)
@@ -120,7 +120,7 @@ fixsymbol(Elf *e, Elf_Data *data, size_t idx, int nprobes, char *buf,
}
#endif
-#if defined(sun)
+#ifdef illumos
#pragma init(dtrace_dof_init)
#else
static void dtrace_dof_init(void) __attribute__ ((constructor));
@@ -129,7 +129,7 @@ static void dtrace_dof_init(void) __attribute__ ((constructor));
static void
dtrace_dof_init(void)
{
-#if defined(sun)
+#ifdef illumos
dof_hdr_t *dof = &__SUNW_dof;
#else
dof_hdr_t *dof = NULL;
@@ -141,7 +141,7 @@ dtrace_dof_init(void)
#endif
dof_helper_t dh;
Link_map *lmp;
-#if defined(sun)
+#ifdef illumos
Lmid_t lmid;
#else
u_long lmid = 0;
@@ -151,7 +151,7 @@ dtrace_dof_init(void)
#endif
int fd;
const char *p;
-#if !defined(sun)
+#ifndef illumos
Elf *e;
Elf_Scn *scn = NULL;
Elf_Data *symtabdata = NULL, *dynsymdata = NULL, *dofdata = NULL;
@@ -177,7 +177,7 @@ dtrace_dof_init(void)
return;
}
-#if defined(sun)
+#ifdef illumos
if (dlinfo(RTLD_SELF, RTLD_DI_LMID, &lmid) == -1) {
dprintf(1, "couldn't discover link map ID\n");
return;
@@ -189,7 +189,7 @@ dtrace_dof_init(void)
modname = lmp->l_name;
else
modname++;
-#if !defined(sun)
+#ifndef illumos
elf_version(EV_CURRENT);
if ((efd = open(lmp->l_name, O_RDONLY, 0)) < 0) {
dprintf(1, "couldn't open file for reading\n");
@@ -258,7 +258,7 @@ dtrace_dof_init(void)
if ((fd = open64(devnamep, O_RDWR)) < 0) {
dprintf(1, "failed to open helper device %s", devnamep);
-#if defined(sun)
+#ifdef illumos
/*
* If the device path wasn't explicitly set, try again with
* the old device path.
@@ -350,14 +350,14 @@ dtrace_dof_init(void)
dprintf(1, "DTrace ioctl failed for DOF at %p", dof);
else {
dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof);
-#if !defined(sun)
+#ifndef illumos
gen = dh.gen;
#endif
}
(void) close(fd);
-#if !defined(sun)
+#ifndef illumos
/* End of while loop */
dof = dof_next;
}
@@ -367,7 +367,7 @@ dtrace_dof_init(void)
#endif
}
-#if defined(sun)
+#ifdef illumos
#pragma fini(dtrace_dof_fini)
#else
static void dtrace_dof_fini(void) __attribute__ ((destructor));
OpenPOWER on IntegriCloud