Skip to content

Commit ceada6c

Browse files
committed
[java-interop] Allow non-zero flags values
1 parent 2cf8ac9 commit ceada6c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/java-interop/java-interop-dlfcn.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <winbase.h>
1111
#else
1212
#include <dlfcn.h>
13+
#include <string.h>
1314
#endif
1415

1516
static char *
@@ -93,10 +94,19 @@ java_interop_load_library (const char *path, unsigned int flags, char **error)
9394
_set_error (error, "path=nullptr is not supported");
9495
return nullptr;
9596
}
97+
#if 0
9698
if (flags != 0) {
9799
_set_error (error, "flags has unsupported value");
98100
return nullptr;
99101
}
102+
#elif !defined (WINDOWS)
103+
char buf[512];
104+
buf[0] = '\0';
105+
if ((flags & RTLD_LAZY) == RTLD_LAZY) strcat (buf, " RTLD_LAZY");
106+
if ((flags & RTLD_GLOBAL) == RTLD_GLOBAL) strcat (buf, " RTLD_GLOBAL");
107+
if ((flags & RTLD_NOW) == RTLD_NOW) strcat (buf, " RTLD_NOW");
108+
log_warn (LOG_DEFAULT, "# jonp: java_interop_load_library flags=%s", buf);
109+
#endif
100110

101111
void *handle = nullptr;
102112

0 commit comments

Comments
 (0)