LibC: Fix RTLD_* definitions
This commit is contained in:
parent
ee507de154
commit
160a9278c9
|
|
@ -7,10 +7,13 @@
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define RTLD_LAZY 1
|
||||
#define RTLD_NOW 2
|
||||
#define RTLD_GLOBAL 3
|
||||
#define RTLD_LOCAL 4
|
||||
#define RTLD_LAZY 0x0
|
||||
#define RTLD_NOW 0x1
|
||||
#define RTLD_GLOBAL 0x0
|
||||
#define RTLD_LOCAL 0x2
|
||||
|
||||
#define _RTLD_LAZY_NOW_MASK 0x1
|
||||
#define _RTLD_GLOBAL_LOCAL_MASK 0x2
|
||||
|
||||
#define RTLD_NEXT ((void*)-1)
|
||||
#define RTLD_DEFAULT ((void*) 0)
|
||||
|
|
|
|||
|
|
@ -1506,9 +1506,11 @@ char* __dlerror(void)
|
|||
|
||||
void* __dlopen(const char* file, int mode)
|
||||
{
|
||||
const bool lazy = !(mode & RTLD_NOW);
|
||||
const bool lazy = (mode & _RTLD_LAZY_NOW_MASK) == RTLD_LAZY;
|
||||
const bool local = (mode & _RTLD_GLOBAL_LOCAL_MASK) == RTLD_LOCAL;
|
||||
|
||||
// FIXME: RTLD_{LOCAL,GLOBAL}
|
||||
if (local)
|
||||
print(STDDBG_FILENO, "local dlopen is not supported, loading as global\n");
|
||||
|
||||
if (file == nullptr)
|
||||
return &s_loaded_files[0];
|
||||
|
|
|
|||
Loading…
Reference in New Issue