/*
* 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
*/
/*
*/
#include <link.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include "env.h"
#include "mach.h"
/*
* It's not possible to gather the return code on routines
* which actually have a dependence on the 'stack frame structure'.
* Below is a list of known symbols which have this dependency,
* truss.so will disable the la_pltexit() entry point for these
* routines, which will remove the requirement for the extra
* stackframe that the link_auditing interface creates.
*
* NOTE: this list *must* be mainted in alphabetical order.
* if this list ever became to long a faster search mechanism
* should be considered.
*/
static char *spec_sym[] = {
#if defined(__sparc)
".stret1",
".stret2",
".stret4",
".stret8",
#endif
"__getcontext",
"_getcontext",
"_getsp",
"_longjmp",
"_setcontext",
"_setjmp",
"_siglongjmp",
"_sigsetjmp",
"_vfork",
"getcontext",
"getsp",
"longjmp",
"setcontext",
"setjmp",
"siglongjmp",
"sigsetjmp",
"vfork",
(char *)0
};
{
char *str;
if (version > LAV_CURRENT)
version);
if (checkenv((const char *)"TRUSS_PID")) {
pidout = 1;
} else {
/*
* This disables truss output in subsequent fork()/exec
* processes.
*/
}
if (checkenv((const char *)"TRUSS_NOEXIT")) {
noexit++;
indent = 0;
}
if (checkenv((const char *)"TRUSS_NOINDENT"))
indent = 0;
if (checkenv((const char *)"TRUSS_ALL"))
trussall++;
if (pidout)
(int)pid);
else
} else
"truss.so: unable to open file=`%s': %s\n",
}
/*
* Initalize iset to the full set of signals to be masked durring
*/
(void) sigfillset(&iset);
return (LAV_CURRENT);
}
/* ARGSUSED1 */
{
char *basename;
else
flags = 0;
flags |= LA_FLG_BINDFROM;
first = 0;
if (flags) {
basename++;
else
}
return (flags);
}
/* ARGSUSED1 */
#if defined(_LP64)
#else
#endif
{
#if !defined(_LP64)
#endif
if (noexit)
/*
* Check to see if this symbol is one of the 'special' symbols.
* If so we disable PLTEXIT calls for that symbol.
*/
if ((*sb_flags & LA_SYMB_NOPLTEXIT) == 0) {
char *str;
/* LINTED */
int cmpval;
if (cmpval < 0)
break;
if (cmpval == 0) {
break;
}
}
}
}
/* ARGSUSED1 */
#if defined(__sparcv9)
const char *sym_name)
const char *sym_name)
#endif
{
char *istr;
#if !defined(_LP64)
#endif
if (pidout)
if ((*sb_flags & LA_SYMB_NOPLTEXIT) == 0)
istr = "";
else
istr = "*";
indent_level++;
}
/* ARGSUSED1 */
#if defined(_LP64)
/* ARGSUSED */
#else
#endif
{
#if !defined(_LP64)
#endif
if (pidout)
if (indent)
indent_level--;
return (retval);
}