< prev index next >

hotspot/agent/src/share/native/sadis.c

Print this page




  76             NULL,
  77             errval,
  78             0,
  79             buf,
  80             (DWORD)len,
  81             NULL);
  82       if (n > 3) {
  83         /* Drop final '.', CR, LF */
  84         if (buf[n - 1] == '\n') n--;
  85         if (buf[n - 1] == '\r') n--;
  86         if (buf[n - 1] == '.') n--;
  87         buf[n] = '\0';
  88       }
  89       return (int)n;
  90     }
  91 
  92     if (errno != 0)
  93     {
  94       /* C runtime error that has no corresponding DOS error code */
  95       strerror_s(buf, len, errno);
  96       return strlen(buf);
  97     }
  98     return 0;
  99 }
 100 #endif /* _WINDOWS */
 101 
 102 /*
 103  * Class:     sun_jvm_hotspot_asm_Disassembler
 104  * Method:    load_library
 105  * Signature: (Ljava/lang/String;)L
 106  */
 107 JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_asm_Disassembler_load_1library(JNIEnv * env,
 108                                                                            jclass disclass,
 109                                                                            jstring jrepath_s,
 110                                                                            jstring libname_s) {
 111   uintptr_t func = 0;
 112   const char *error_message = NULL;
 113   const char *jrepath = NULL;
 114   const char *libname = NULL;
 115   char buffer[128];
 116 




  76             NULL,
  77             errval,
  78             0,
  79             buf,
  80             (DWORD)len,
  81             NULL);
  82       if (n > 3) {
  83         /* Drop final '.', CR, LF */
  84         if (buf[n - 1] == '\n') n--;
  85         if (buf[n - 1] == '\r') n--;
  86         if (buf[n - 1] == '.') n--;
  87         buf[n] = '\0';
  88       }
  89       return (int)n;
  90     }
  91 
  92     if (errno != 0)
  93     {
  94       /* C runtime error that has no corresponding DOS error code */
  95       strerror_s(buf, len, errno);
  96       return (int)strlen(buf);
  97     }
  98     return 0;
  99 }
 100 #endif /* _WINDOWS */
 101 
 102 /*
 103  * Class:     sun_jvm_hotspot_asm_Disassembler
 104  * Method:    load_library
 105  * Signature: (Ljava/lang/String;)L
 106  */
 107 JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_asm_Disassembler_load_1library(JNIEnv * env,
 108                                                                            jclass disclass,
 109                                                                            jstring jrepath_s,
 110                                                                            jstring libname_s) {
 111   uintptr_t func = 0;
 112   const char *error_message = NULL;
 113   const char *jrepath = NULL;
 114   const char *libname = NULL;
 115   char buffer[128];
 116 


< prev index next >