dlfcn.h revision 50603
1139826Simp/*
253541Sshin * Copyright (c) 1994
353541Sshin *	The Regents of the University of California.  All rights reserved.
453541Sshin *
553541Sshin * Redistribution and use in source and binary forms, with or without
653541Sshin * modification, are permitted provided that the following conditions
753541Sshin * are met:
853541Sshin * 1. Redistributions of source code must retain the above copyright
953541Sshin *    notice, this list of conditions and the following disclaimer.
1053541Sshin * 2. Redistributions in binary form must reproduce the above copyright
1153541Sshin *    notice, this list of conditions and the following disclaimer in the
1253541Sshin *    documentation and/or other materials provided with the distribution.
1353541Sshin * 3. All advertising materials mentioning features or use of this software
1453541Sshin *    must display the following acknowledgement:
1553541Sshin *	This product includes software developed by the University of
1653541Sshin *	California, Berkeley and its contributors.
1753541Sshin * 4. Neither the name of the University nor the names of its contributors
1853541Sshin *    may be used to endorse or promote products derived from this software
1953541Sshin *    without specific prior written permission.
2053541Sshin *
2153541Sshin * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2253541Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2353541Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2453541Sshin * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2553541Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2653541Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2753541Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28174510Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29174510Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3053541Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3153541Sshin * SUCH DAMAGE.
32174510Sobrien *
33174510Sobrien * $FreeBSD: head/include/dlfcn.h 50603 1999-08-30 00:50:12Z jdp $
34174510Sobrien */
3562587Sitojun
3662587Sitojun#ifndef _DLFCN_H_
37101240Srwatson#define	_DLFCN_H_
38189106Sbz#include <sys/cdefs.h>
3962587Sitojun
4053541Sshin/*
4153541Sshin * Modes and flags for dlopen().
4278064Sume */
4353541Sshin#define RTLD_LAZY	1	/* Bind function calls lazily */
4453541Sshin#define RTLD_NOW	2	/* Bind function calls immediately */
4553541Sshin#define RTLD_MODEMASK	0x3
4653541Sshin#define RTLD_GLOBAL	0x100	/* Make symbols globally available */
4753541Sshin
4853541Sshin/*
4962587Sitojun * Special handle argument for dlsym().  It causes the search for the
5053541Sshin * symbol to begin in the next shared object after the one containing
5153541Sshin * the caller.
52186119Sqingli */
53186119Sqingli#define RTLD_NEXT	((void *) -1)
5453541Sshin
5578064Sume/*
56189103Sbz * Structure filled in by dladdr().
5753541Sshin */
5853541Sshintypedef struct dl_info {
59121283Sume	const char	*dli_fname;	/* Pathname of shared object */
6053541Sshin	void		*dli_fbase;	/* Base address of shared object */
6153541Sshin	const char	*dli_sname;	/* Name of nearest symbol */
62120049Smdodd	void		*dli_saddr;	/* Address of nearest symbol */
6393920Smdodd} Dl_info;
6453541Sshin
65185571Sbz__BEGIN_DECLS
6653541Sshinint dladdr __P((const void *, Dl_info *));
6753541Sshinint dlclose __P((void *));
68186119Sqingliconst char *dlerror __P((void));
69186119Sqinglivoid *dlopen __P((const char *, int));
7053541Sshinvoid *dlsym __P((void *, const char *));
7153541Sshin__END_DECLS
7262587Sitojun
7353541Sshin#endif /* !_DLFCN_H_ */
74148385Sume