< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page
rev 49818 : 8201649: Remove dubious call_jio_print in ostream.cpp

@@ -2714,11 +2714,12 @@
 
 // Printing support //////////////////////////////////////////////////
 extern "C" {
 
 ATTRIBUTE_PRINTF(3, 0)
-int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
+JNIEXPORT int
+jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
   // Reject count values that are negative signed values converted to
   // unsigned; see bug 4399518, 4417214
   if ((intptr_t)count <= 0) return -1;
 
   int result = os::vsnprintf(str, count, fmt, args);

@@ -2728,60 +2729,41 @@
 
   return result;
 }
 
 ATTRIBUTE_PRINTF(3, 4)
-int jio_snprintf(char *str, size_t count, const char *fmt, ...) {
+JNIEXPORT int
+jio_snprintf(char *str, size_t count, const char *fmt, ...) {
   va_list args;
   int len;
   va_start(args, fmt);
   len = jio_vsnprintf(str, count, fmt, args);
   va_end(args);
   return len;
 }
 
 ATTRIBUTE_PRINTF(2, 3)
-int jio_fprintf(FILE* f, const char *fmt, ...) {
+JNIEXPORT int
+jio_fprintf(FILE* f, const char *fmt, ...) {
   int len;
   va_list args;
   va_start(args, fmt);
   len = jio_vfprintf(f, fmt, args);
   va_end(args);
   return len;
 }
 
 ATTRIBUTE_PRINTF(2, 0)
-int jio_vfprintf(FILE* f, const char *fmt, va_list args) {
+JNIEXPORT int
+jio_vfprintf(FILE* f, const char *fmt, va_list args) {
   if (Arguments::vfprintf_hook() != NULL) {
      return Arguments::vfprintf_hook()(f, fmt, args);
   } else {
     return vfprintf(f, fmt, args);
   }
 }
 
-ATTRIBUTE_PRINTF(1, 2)
-JNIEXPORT int jio_printf(const char *fmt, ...) {
-  int len;
-  va_list args;
-  va_start(args, fmt);
-  len = jio_vfprintf(defaultStream::output_stream(), fmt, args);
-  va_end(args);
-  return len;
-}
-
-
-// HotSpot specific jio method
-void jio_print(const char* s) {
-  // Try to make this function as atomic as possible.
-  if (Arguments::vfprintf_hook() != NULL) {
-    jio_fprintf(defaultStream::output_stream(), "%s", s);
-  } else {
-    // Make an unused local variable to avoid warning from gcc 4.x compiler.
-    size_t count = ::write(defaultStream::output_fd(), s, (int)strlen(s));
-  }
-}
-
 } // Extern C
 
 // java.lang.Thread //////////////////////////////////////////////////////////////////////////////
 
 // In most of the JVM thread support functions we need to access the
< prev index next >