dlfcn.h revision 45398
162321Salfred/* 262321Salfred * Copyright (c) 1994 362321Salfred * The Regents of the University of California. All rights reserved. 462321Salfred * 562321Salfred * Redistribution and use in source and binary forms, with or without 662321Salfred * modification, are permitted provided that the following conditions 762321Salfred * are met: 862321Salfred * 1. Redistributions of source code must retain the above copyright 962321Salfred * notice, this list of conditions and the following disclaimer. 1062321Salfred * 2. Redistributions in binary form must reproduce the above copyright 1162321Salfred * notice, this list of conditions and the following disclaimer in the 1262321Salfred * documentation and/or other materials provided with the distribution. 1362321Salfred * 3. All advertising materials mentioning features or use of this software 1462321Salfred * must display the following acknowledgement: 1592986Sobrien * This product includes software developed by the University of 1662321Salfred * California, Berkeley and its contributors. 1762321Salfred * 4. Neither the name of the University nor the names of its contributors 1862321Salfred * may be used to endorse or promote products derived from this software 1992986Sobrien * without specific prior written permission. 2092986Sobrien * 2162321Salfred * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2262321Salfred * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2362321Salfred * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2462321Salfred * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2562321Salfred * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2662321Salfred * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2762321Salfred * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2862321Salfred * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2962321Salfred * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3062321Salfred * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3162321Salfred * SUCH DAMAGE. 3262321Salfred * 3392905Sobrien * $Id: dlfcn.h,v 1.2 1998/02/11 05:19:10 jdp Exp $ 3462321Salfred */ 3562321Salfred 3662321Salfred#ifndef _DLFCN_H_ 3762321Salfred#define _DLFCN_H_ 3862321Salfred#include <sys/cdefs.h> 3962321Salfred 4062321Salfred/* 4162321Salfred * Modes for dlopen(). 4262321Salfred */ 4362321Salfred#define RTLD_LAZY 1 /* Bind function calls lazily */ 4462321Salfred#define RTLD_NOW 2 /* Bind function calls immediately */ 4562321Salfred 4662321Salfred/* 4762321Salfred * Special handle argument for dlsym(). It causes the search for the 4862321Salfred * symbol to begin in the next shared object after the one containing 4962321Salfred * the caller. 5062321Salfred */ 5162321Salfred#define RTLD_NEXT ((void *) -1) 5262321Salfred 5362321Salfred/* 5462321Salfred * Structure filled in by dladdr(). 5562321Salfred */ 5662321Salfredtypedef struct dl_info { 5762321Salfred const char *dli_fname; /* Pathname of shared object */ 5862321Salfred void *dli_fbase; /* Base address of shared object */ 5962321Salfred const char *dli_sname; /* Name of nearest symbol */ 6062321Salfred void *dli_saddr; /* Address of nearest symbol */ 6162321Salfred} Dl_info; 6262321Salfred 6362321Salfred__BEGIN_DECLS 6462321Salfredint dladdr __P((const void *, Dl_info *)); 6562321Salfredint dlclose __P((void *)); 6662321Salfredconst char *dlerror __P((void)); 6762321Salfredvoid *dlopen __P((const char *, int)); 6862321Salfredvoid *dlsym __P((void *, const char *)); 69int dlversion __P((void)); 70__END_DECLS 71 72#endif /* !_DLFCN_H_ */ 73