diff options
Diffstat (limited to 'dlfcn.h')
-rw-r--r-- | dlfcn.h | 29 |
1 files changed, 22 insertions, 7 deletions
@@ -30,26 +30,41 @@ extern "C" { | |||
30 | # define DLFCN_EXPORT | 30 | # define DLFCN_EXPORT |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | /* POSIX says these are implementation-defined. | 33 | /* Relocations are performed when the object is loaded. */ |
34 | * To simplify use with Windows API, we treat them the same way. | ||
35 | */ | ||
36 | |||
37 | #define RTLD_LAZY 0 | ||
38 | #define RTLD_NOW 0 | 34 | #define RTLD_NOW 0 |
39 | 35 | ||
36 | /* Relocations are performed at an implementation-defined time. | ||
37 | * Windows API does not support lazy symbol resolving (when first reference | ||
38 | * to a given symbol occurs). So RTLD_LAZY implementation is same as RTLD_NOW. | ||
39 | */ | ||
40 | #define RTLD_LAZY RTLD_NOW | ||
41 | |||
42 | /* All symbols are available for relocation processing of other modules. */ | ||
40 | #define RTLD_GLOBAL (1 << 1) | 43 | #define RTLD_GLOBAL (1 << 1) |
44 | |||
45 | /* All symbols are not made available for relocation processing by other modules. */ | ||
41 | #define RTLD_LOCAL (1 << 2) | 46 | #define RTLD_LOCAL (1 << 2) |
42 | 47 | ||
43 | /* These two were added in The Open Group Base Specifications Issue 6. | 48 | /* These two were added in The Open Group Base Specifications Issue 6. |
44 | * Note: All other RTLD_* flags in any dlfcn.h are not standard compliant. | 49 | * Note: All other RTLD_* flags in any dlfcn.h are not standard compliant. |
45 | */ | 50 | */ |
46 | 51 | ||
52 | /* The symbol lookup happens in the normal global scope. */ | ||
47 | #define RTLD_DEFAULT ((void *)0) | 53 | #define RTLD_DEFAULT ((void *)0) |
54 | |||
55 | /* Specifies the next object after this one that defines name. */ | ||
48 | #define RTLD_NEXT ((void *)-1) | 56 | #define RTLD_NEXT ((void *)-1) |
49 | 57 | ||
50 | DLFCN_EXPORT void *dlopen ( const char *file, int mode ); | 58 | /* Open a symbol table handle. */ |
51 | DLFCN_EXPORT int dlclose(void *handle); | 59 | DLFCN_EXPORT void *dlopen(const char *file, int mode); |
60 | |||
61 | /* Close a symbol table handle. */ | ||
62 | DLFCN_EXPORT int dlclose(void *handle); | ||
63 | |||
64 | /* Get the address of a symbol from a symbol table handle. */ | ||
52 | DLFCN_EXPORT void *dlsym(void *handle, const char *name); | 65 | DLFCN_EXPORT void *dlsym(void *handle, const char *name); |
66 | |||
67 | /* Get diagnostic information. */ | ||
53 | DLFCN_EXPORT char *dlerror(void); | 68 | DLFCN_EXPORT char *dlerror(void); |
54 | 69 | ||
55 | #ifdef __cplusplus | 70 | #ifdef __cplusplus |