xref: /illumos-gate/usr/src/head/execinfo.h (revision f151e4bf7906a0c28313c7fae16eef109aa68fc0)
1*f151e4bfSbarts /*
2*f151e4bfSbarts  * CDDL HEADER START
3*f151e4bfSbarts  *
4*f151e4bfSbarts  * The contents of this file are subject to the terms of the
5*f151e4bfSbarts  * Common Development and Distribution License (the "License").
6*f151e4bfSbarts  * You may not use this file except in compliance with the License.
7*f151e4bfSbarts  *
8*f151e4bfSbarts  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*f151e4bfSbarts  * or http://www.opensolaris.org/os/licensing.
10*f151e4bfSbarts  * See the License for the specific language governing permissions
11*f151e4bfSbarts  * and limitations under the License.
12*f151e4bfSbarts  *
13*f151e4bfSbarts  * When distributing Covered Code, include this CDDL HEADER in each
14*f151e4bfSbarts  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*f151e4bfSbarts  * If applicable, add the following below this CDDL HEADER, with the
16*f151e4bfSbarts  * fields enclosed by brackets "[]" replaced with your own identifying
17*f151e4bfSbarts  * information: Portions Copyright [yyyy] [name of copyright owner]
18*f151e4bfSbarts  *
19*f151e4bfSbarts  * CDDL HEADER END
20*f151e4bfSbarts  */
21*f151e4bfSbarts /*
22*f151e4bfSbarts  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*f151e4bfSbarts  * Use is subject to license terms.
24*f151e4bfSbarts  */
25*f151e4bfSbarts 
26*f151e4bfSbarts #ifndef	_EXECINFO_H
27*f151e4bfSbarts #define	_EXECINFO_H
28*f151e4bfSbarts 
29*f151e4bfSbarts #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*f151e4bfSbarts 
31*f151e4bfSbarts /*
32*f151e4bfSbarts  * These functions provide glibc-compatible backtrace functionality.
33*f151e4bfSbarts  * Improved functionality is available using Solaris-specific APIs;
34*f151e4bfSbarts  * see man page for walkcontext(), printstack() and addtosymstr().
35*f151e4bfSbarts  */
36*f151e4bfSbarts #ifdef	__cplusplus
37*f151e4bfSbarts extern "C" {
38*f151e4bfSbarts #endif
39*f151e4bfSbarts 
40*f151e4bfSbarts #if defined(__STDC__)
41*f151e4bfSbarts extern int backtrace(void **, int);
42*f151e4bfSbarts extern char **backtrace_symbols(void *const *, int);
43*f151e4bfSbarts extern void backtrace_symbols_fd(void *const *, int, int);
44*f151e4bfSbarts #else
45*f151e4bfSbarts extern int backtrace();
46*f151e4bfSbarts extern char **backtrace_symbols();
47*f151e4bfSbarts extern void backtrace_symbols_fd();
48*f151e4bfSbarts #endif
49*f151e4bfSbarts 
50*f151e4bfSbarts #ifdef	__cplusplus
51*f151e4bfSbarts }
52*f151e4bfSbarts #endif
53*f151e4bfSbarts 
54*f151e4bfSbarts #endif /* _EXECINFO_H */
55