* sysdeps/unix/Makefile: Include $(common-objpfx)s-proto-bp.d.
[glibc.git] / include / dlfcn.h
blobfd1c8a96a2f051b82ef49708b5d2af6dc18866ca
1 #ifndef _DLFCN_H
2 #include <dlfcn/dlfcn.h>
4 /* Internally used flag. */
5 #define __RTLD_DLOPEN 0x80000000
6 #define __RTLD_SPROF 0x40000000
8 /* Now define the internal interfaces. */
9 extern void *__dlvsym (void *__handle, __const char *__name,
10 __const char *__version);
12 #define __libc_dlopen(name) __libc_dlopen_mode (name, RTLD_LAZY)
13 extern void *__libc_dlopen_mode (__const char *__name, int __mode);
14 extern void *__libc_dlsym (void *__map, __const char *__name);
15 extern int __libc_dlclose (void *__map);
17 /* Locate shared object containing the given address. */
18 extern int _dl_addr (const void *address, Dl_info *info)
19 internal_function;
20 libc_hidden_proto (_dl_addr)
22 /* Open the shared object NAME, relocate it, and run its initializer if it
23 hasn't already been run. MODE is as for `dlopen' (see <dlfcn.h>). If
24 the object is already opened, returns its existing map. */
25 extern void *_dl_open (const char *name, int mode, const void *caller)
26 internal_function;
27 libc_hidden_proto (_dl_open)
29 /* Close an object previously opened by _dl_open. */
30 extern void _dl_close (void *map)
31 internal_function;
32 libc_hidden_proto (_dl_close)
34 /* Look up NAME in shared object HANDLE (which may be RTLD_DEFAULT or
35 RTLD_NEXT). WHO is the calling function, for RTLD_NEXT. Returns
36 the symbol value, which may be NULL. */
37 extern void *_dl_sym (void *handle, const char *name, void *who)
38 internal_function;
40 /* Look up version VERSION of symbol NAME in shared object HANDLE
41 (which may be RTLD_DEFAULT or RTLD_NEXT). WHO is the calling
42 function, for RTLD_NEXT. Returns the symbol value, which may be
43 NULL. */
44 extern void *_dl_vsym (void *handle, const char *name, const char *version,
45 void *who)
46 internal_function;
48 /* Call OPERATE, catching errors from `dl_signal_error'. If there is no
49 error, *ERRSTRING is set to null. If there is an error, *ERRSTRING is
50 set to a string constructed from the strings passed to _dl_signal_error,
51 and the error code passed is the return value and *OBJNAME is set to
52 the object name which experienced the problems. ERRSTRING if nonzero
53 points to a malloc'ed string which the caller has to free after use.
54 ARGS is passed as argument to OPERATE. */
55 extern int _dl_catch_error (const char **objname, const char **errstring,
56 void (*operate) (void *),
57 void *args)
58 internal_function;
59 extern int _dl_catch_error_internal (const char **objname,
60 const char **errstring,
61 void (*operate) (void *), void *args)
62 internal_function;
64 /* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
65 _dl_catch_error. Returns zero for success, nonzero for failure; and
66 arranges for `dlerror' to return the error details.
67 ARGS is passed as argument to OPERATE. */
68 extern int _dlerror_run (void (*operate) (void *), void *args)
69 internal_function;
71 #endif