/*
* 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.
*/
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
/*
* Common functions for helper provider loading both compiled into the
* executable via drti.o and dtrace(1M) -G, and the libdaudit.so library.
*/
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dlink.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.
*/
void
{
if (debug && !dof_init_debug)
return;
}
/*
* 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
*/
void
dtrace_link_init(void)
{
}
void
{
const char *modname;
const char *p;
#ifdef _LP64
#else
#endif
int fd;
return;
else
modname++;
return;
}
if (lmid == LM_ID_BASE) {
"%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;
}
}
name);
} else {
name);
}
}