$OpenBSD: patch-jdk_src_solaris_native_sun_nio_fs_UnixNativeDispatcher_c,v 1.2 2009/10/07 01:53:54 kurt Exp $
--- jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c.orig	Thu Sep 17 03:52:33 2009
+++ jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Sun Sep 27 10:27:09 2009
@@ -49,6 +49,11 @@
 #include <mntent.h>
 #endif
 
+#ifdef _ALLBSD_SOURCE
+#include <string.h>
+#include "largefile_bsd.h"
+#endif
+
 #include "jni.h"
 #include "jni_util.h"
 #include "jlong.h"
@@ -213,6 +218,8 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env,
         flags |= sun_nio_fs_UnixNativeDispatcher_HAS_AT_SYSCALLS;
     }
 
+    my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir");
+
     return flags;
 }
 
@@ -1016,6 +1023,10 @@ Java_sun_nio_fs_UnixNativeDispatcher_getextmntent(JNIE
 {
 #ifdef __solaris__
     struct extmnttab ent;
+#elif defined(_ALLBSD_SOURCE)
+    char buf[1024];
+    char *str;
+    char *last;
 #else
     struct mntent ent;
     char buf[1024];
@@ -1044,6 +1055,25 @@ Java_sun_nio_fs_UnixNativeDispatcher_getextmntent(JNIE
         throwUnixException(env, errno);
         return -1;
     }
+#elif defined(_ALLBSD_SOURCE)
+again:
+    if (!(str = fgets(buf, sizeof(buf), fp)))    
+        return -1;
+
+    name = strtok_r(str, " \t\n", &last);
+    if (name == NULL)
+        return -1;
+ 
+    // skip comments
+    if (*name == '#')
+        goto again;
+
+    dir = strtok_r((char *)NULL, " \t\n", &last);
+    fstype = strtok_r((char *)NULL, " \t\n", &last);
+    options = strtok_r((char *)NULL, " \t\n", &last);
+    if (options == NULL)
+        return -1;
+    dev = 0;
 #else
     m = getmntent_r(fp, &ent, (char*)&buf, buflen);
     if (m == NULL)
