/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <unistd.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <link.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
/*
* In Solaris 10 GA, the only mechanism for communicating helper information
* is through the DTrace helper pseudo-device node in /devices; there is
* no /dev link. Because of this, USDT providers and helper actions don't
* work inside of non-global zones. This issue was addressed by adding
* the /dev and having this initialization code use that /dev link. If the
* /dev link doesn't exist it falls back to looking for the /devices node
* as this code may be embedded in a binary which runs on Solaris 10 GA.
*
* Users may set the following environment variable to affect the way
* helper initialization takes place:
*
* DTRACE_DOF_INIT_DEBUG enable debugging output
* DTRACE_DOF_INIT_DISABLE disable helper loading
* DTRACE_DOF_INIT_DEVNAME set the path to the helper node
*/
static void
{
if (debug && !dof_init_debug)
return;
else
}
#pragma init(dtrace_dof_init)
static void
dtrace_dof_init(void)
{
#ifdef _LP64
#else
#endif
int fd;
const char *p;
return;
return;
}
return;
}
else
modname++;
dprintf(0, ".SUNW_dof section corrupt\n");
return;
}
if (lmid == 0) {
"%s", modname);
} else {
}
devname = p;
/*
* If the device path wasn't explicitly set, try again with
* the old device path.
*/
if (p != NULL)
return;
return;
}
}
else
}
#pragma fini(dtrace_dof_fini)
static void
dtrace_dof_fini(void)
{
int fd;
return;
}
else
}