$OpenBSD: patch-hotspot_src_share_vm_runtime_os_cpp,v 1.5 2011/01/11 15:47:49 kurt Exp $
--- hotspot/src/share/vm/runtime/os.cpp.orig	Thu Dec 16 16:53:09 2010
+++ hotspot/src/share/vm/runtime/os.cpp	Wed Jan  5 22:30:08 2011
@@ -79,7 +79,11 @@ char* os::iso8601_time(char* buffer, size_t buffer_len
     assert(false, "Failed localtime_pd");
     return NULL;
   }
+#if defined(_ALLBSD_SOURCE)
+  const time_t zone = (time_t) time_struct.tm_gmtoff;
+#else
   const time_t zone = timezone;
+#endif
 
   // If daylight savings time is in effect,
   // we are 1 hour East of our time zone
@@ -347,6 +351,12 @@ void* os::native_java_library() {
     if (_native_java_library == NULL) {
       vm_exit_during_initialization("Unable to load native library", ebuf);
     }
+#if defined(__OpenBSD__)
+    // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
+    // ignore errors
+    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "net");
+    dll_load(buffer, ebuf, sizeof(ebuf));
+#endif
   }
   static jboolean onLoaded = JNI_FALSE;
   if (onLoaded) {
