summaryrefslogtreecommitdiff
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.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
index 6f3c9c7d3de9..fdfe416804fc 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)
+#ifdef illumos
#pragma init(dtrace_dof_init)
#else
static void dtrace_dof_init(void) __attribute__ ((constructor));
@@ -99,7 +99,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;
@@ -111,14 +111,14 @@ dtrace_dof_init(void)
#endif
dof_helper_t dh;
Link_map *lmp = NULL;
-#if defined(sun)
+#ifdef illumos
Lmid_t lmid;
#else
u_long lmid = 0;
#endif
int fd;
const char *p;
-#if !defined(sun)
+#ifndef illumos
Elf *e;
Elf_Scn *scn = NULL;
Elf_Data *dofdata = NULL;
@@ -141,7 +141,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;
@@ -152,7 +152,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");
@@ -215,7 +215,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.
@@ -237,14 +237,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;
}
@@ -254,7 +254,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));