dlfcn.h revision 959ee9437869ba1ddb2763b82b8773f25e5871d0
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 1989 AT&T
* All Rights Reserved
*
*/
#ifndef _DLFCN_H
#define _DLFCN_H
#include <sys/feature_tests.h>
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
#ifdef __cplusplus
extern "C" {
#endif
/*
* Information structures for various dlinfo() requests.
*/
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
#ifdef __STDC__
typedef struct dl_info {
const char *dli_fname; /* file containing address range */
void *dli_fbase; /* base address of file image */
const char *dli_sname; /* symbol name */
void *dli_saddr; /* symbol address */
} Dl_info;
#else
typedef struct dl_info {
char *dli_fname;
void *dli_fbase;
char *dli_sname;
void *dli_saddr;
} Dl_info;
#endif /* __STDC__ */
typedef struct dl_serpath {
char *dls_name; /* library search path name */
} Dl_serpath;
typedef Dl_serpath Dl_serpath_t;
typedef struct dl_serinfo {
} Dl_serinfo;
typedef Dl_serinfo Dl_serinfo_t;
typedef struct dl_argsinfo {
long dla_argc; /* process argument count */
char **dla_argv; /* process arguments */
char **dla_envp; /* process environment variables */
} Dl_argsinfo;
typedef Dl_argsinfo Dl_argsinfo_t;
typedef struct {
} Dl_mapinfo_t;
typedef struct {
char *dlui_objname; /* path to object */
void *dlui_unwindstart; /* star of unwind hdr */
void *dlui_unwindend; /* end of unwind hdr */
void *dlui_segstart; /* start of segment described */
/* by unwind block */
void *dlui_segend; /* end of segment described */
/* by unwind block */
typedef Dl_amd64_unwindinfo Dl_amd64_unwindinfo_t;
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
/*
* Declarations used for dynamic linking support routines.
*/
#ifdef __STDC__
extern void *dlopen(const char *, int);
extern int dlclose(void *);
extern char *dlerror(void);
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
extern int dldump(const char *, const char *, int);
extern int dlinfo(void *, int, void *);
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
#else
extern void *dlopen();
extern void *dlsym();
extern int dlclose();
extern char *dlerror();
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
extern void *dlmopen();
extern int dladdr();
extern int dladdr1();
extern int dldump();
extern int dlinfo();
extern Dl_amd64_unwindinfo *dlamd64getunwind();
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
#endif /* __STDC__ */
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
/*
* Valid values for handle argument to dlsym(3x).
*/
/* of current object */
/* of current object, */
/* using currently */
/* loaded objects only. */
/*
* Valid values for mode argument to dlopen.
*/
/* to group members */
/* a group dependencies */
/* members of the group */
/* global objects */
/* available for dlsym */
/* internal use only */
/*
* Valid values for flag argument to dldump.
*/
/* bind to main */
/* bind to dependencies */
/* bind to preload objs */
/* bind to ourself */
/* even if unresolved */
/* only */
/* internal use only */
/*
* Valid values for dladdr1() flags.
*/
#define RTLD_DL_MASK 0xffff
/*
* Arguments for dlinfo()
*/
/* internal use only */
/* internal use only */
/* environment and auxv */
#define RTLD_DI_MAX 13
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
/*
* Version information for Dl_amd64_unwindinfo.dlui_version
*/
#define DLUI_VERS_1 1
#define DLUI_VERS_CURRENT DLUI_VERS_1
/*
* Valid flags for Dl_amd64_unwindinfo.dlfi_flags
*/
/* matching the pc provided */
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
#ifdef __cplusplus
}
#endif
#endif /* _DLFCN_H */