src/solaris/native/common/jni_util_md.c

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -23,13 +23,33 @@
  * questions.
  */
 
 #include "jni.h"
 #include "jni_util.h"
+#include "dlfcn.h"
 
 jstring nativeNewStringPlatform(JNIEnv *env, const char *str) {
     return NULL;
 }
 
 char* nativeGetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy) {
     return NULL;
 }
+
+void* getProcessHandle() {
+    static void *procHandle = NULL;
+    if (procHandle != NULL) {
+        return procHandle;
+    }
+    procHandle = (void*)dlopen(NULL, RTLD_LAZY);
+    return procHandle;
+}
+
+void buildJniFunctionName(const char *sym, const char *cname,
+                          char *jniEntryName) {
+    strcpy(jniEntryName, sym);
+    if (cname != NULL) {
+        strcat(jniEntryName, "_");
+        strcat(jniEntryName, cname);
+    }
+}
+