dlfcn.h revision 50473
133236Sjdp/*
233236Sjdp * Copyright (c) 1994
333236Sjdp *	The Regents of the University of California.  All rights reserved.
433236Sjdp *
533236Sjdp * Redistribution and use in source and binary forms, with or without
633236Sjdp * modification, are permitted provided that the following conditions
733236Sjdp * are met:
833236Sjdp * 1. Redistributions of source code must retain the above copyright
933236Sjdp *    notice, this list of conditions and the following disclaimer.
1033236Sjdp * 2. Redistributions in binary form must reproduce the above copyright
1133236Sjdp *    notice, this list of conditions and the following disclaimer in the
1233236Sjdp *    documentation and/or other materials provided with the distribution.
1333236Sjdp * 3. All advertising materials mentioning features or use of this software
1433236Sjdp *    must display the following acknowledgement:
1533236Sjdp *	This product includes software developed by the University of
1633236Sjdp *	California, Berkeley and its contributors.
1733236Sjdp * 4. Neither the name of the University nor the names of its contributors
1833236Sjdp *    may be used to endorse or promote products derived from this software
1933236Sjdp *    without specific prior written permission.
2033236Sjdp *
2133236Sjdp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2233236Sjdp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2333236Sjdp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2433236Sjdp * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2533236Sjdp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2633236Sjdp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2733236Sjdp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2833236Sjdp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2933236Sjdp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3033236Sjdp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3133236Sjdp * SUCH DAMAGE.
3233236Sjdp *
3350473Speter * $FreeBSD: head/include/dlfcn.h 50473 1999-08-27 23:45:13Z peter $
3433236Sjdp */
3533236Sjdp
3633236Sjdp#ifndef _DLFCN_H_
3733236Sjdp#define	_DLFCN_H_
3833236Sjdp#include <sys/cdefs.h>
3933236Sjdp
4033236Sjdp/*
4133236Sjdp * Modes for dlopen().
4233236Sjdp */
4333236Sjdp#define RTLD_LAZY	1	/* Bind function calls lazily */
4433236Sjdp#define RTLD_NOW	2	/* Bind function calls immediately */
4533236Sjdp
4633236Sjdp/*
4733236Sjdp * Special handle argument for dlsym().  It causes the search for the
4833236Sjdp * symbol to begin in the next shared object after the one containing
4933236Sjdp * the caller.
5033236Sjdp */
5133236Sjdp#define RTLD_NEXT	((void *) -1)
5233236Sjdp
5333236Sjdp/*
5433236Sjdp * Structure filled in by dladdr().
5533236Sjdp */
5633236Sjdptypedef struct dl_info {
5733236Sjdp	const char	*dli_fname;	/* Pathname of shared object */
5833236Sjdp	void		*dli_fbase;	/* Base address of shared object */
5933236Sjdp	const char	*dli_sname;	/* Name of nearest symbol */
6033236Sjdp	void		*dli_saddr;	/* Address of nearest symbol */
6133236Sjdp} Dl_info;
6233236Sjdp
6333236Sjdp__BEGIN_DECLS
6433236Sjdpint dladdr __P((const void *, Dl_info *));
6533236Sjdpint dlclose __P((void *));
6633236Sjdpconst char *dlerror __P((void));
6733236Sjdpvoid *dlopen __P((const char *, int));
6833236Sjdpvoid *dlsym __P((void *, const char *));
6933236Sjdp__END_DECLS
7033236Sjdp
7133236Sjdp#endif /* !_DLFCN_H_ */
72