Tue Jun 4 02:25:44 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 #define RTLD_BINDING_MASK 0x3   /* Mask of binding time value.  */
28
29 /* If the following bit is set in the MODE argument to `dlopen',
30    the symbols of the loaded object and its dependencies are made
31    visible as if the object were linked directly into the program.  */
32 #define RTLD_GLOBAL     0x100
33
34 /* Open the shared object FILE and map it in; return a handle that can be
35    passed to `dlsym' to get symbol values from it.  */
36 extern void *dlopen (const char *__file, int __mode);
37
38 /* Unmap and close a shared object opened by `dlopen'.
39    The handle cannot be used again after calling `dlclose'.  */
40 extern int dlclose (void *__handle);
41
42 /* Find the run-time address in the shared object HANDLE refers to
43    of the symbol called NAME.  */
44 extern void *dlsym (void *__handle, const char *__name);
45
46 /* When any of the above functions fails, call this function
47    to return a string describing the error.  Each call resets
48    the error string so that a following call returns null.  */
49 extern char *dlerror (void);
50
51
52 #endif  /* dlfcn.h */