Mon Jun 3 00:30:35 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
[platform/upstream/glibc.git] / elf / dlfcn.h
1 /* dlfcn.h -- User functions for run-time dynamic loading.
2 Copyright (C) 1995, 1996 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB.  If
17 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18 Cambridge, MA 02139, USA.  */
19
20 #ifndef _DLFCN_H
21 #define _DLFCN_H 1
22
23
24 /* The MODE argument to `dlopen' contains one of the following: */
25 #define RTLD_LAZY       0x001   /* Lazy function call binding.  */
26 #define RTLD_NOW        0x002   /* Immediate function call binding.  */
27
28 /* If the following bit is set in the MODE argument to `dlopen',
29    the symbols of the loaded object and its dependencies are made
30    visible as if the object were linked directly into the program.  */
31 #define RTLD_GLOBAL     0x100
32
33 /* Open the shared object FILE and map it in; return a handle that can be
34    passed to `dlsym' to get symbol values from it.  */
35 extern void *dlopen (const char *__file, int __mode);
36
37 /* Unmap and close a shared object opened by `dlopen'.
38    The handle cannot be used again after calling `dlclose'.  */
39 extern int dlclose (void *__handle);
40
41 /* Find the run-time address in the shared object HANDLE refers to
42    of the symbol called NAME.  */
43 extern void *dlsym (void *__handle, const char *__name);
44
45 /* When any of the above functions fails, call this function
46    to return a string describing the error.  Each call resets
47    the error string so that a following call returns null.  */
48 extern char *dlerror (void);
49
50
51 #endif  /* dlfcn.h */