$OpenBSD: patch-jdk_src_solaris_native_sun_nio_fs_genUnixConstants_c,v 1.2 2009/10/07 01:53:54 kurt Exp $
--- jdk/src/solaris/native/sun/nio/fs/genUnixConstants.c.orig	Thu Sep 17 03:52:33 2009
+++ jdk/src/solaris/native/sun/nio/fs/genUnixConstants.c	Sun Sep 27 10:28:59 2009
@@ -63,7 +63,12 @@ int main(int argc, const char* argv[]) {
     DEFX(O_EXCL);
     DEFX(O_TRUNC);
     DEFX(O_SYNC);
+#ifndef O_DSYNC
+    // At least FreeBSD doesn't define O_DSYNC
+    emit("O_DSYNC", O_SYNC);
+#else
     DEFX(O_DSYNC);
+#endif
     DEFX(O_NOFOLLOW);
 
     // mode masks
@@ -106,7 +111,12 @@ int main(int argc, const char* argv[]) {
     DEF(ENOSYS);
     DEF(ELOOP);
     DEF(EROFS);
+#ifndef ENODATA
+    // Only used in Linux java source, provide any value so it compiles
+    emit("ENODATA", ELAST);
+#else
     DEF(ENODATA);
+#endif
     DEF(ERANGE);
 
     // flags used with openat/unlinkat/etc.
