This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libjava/java/io/natFileDescriptorPosix.cc -r1.25 -r1.26


Loren James Rittle wrote:

This patch:

2003-05-13 Michael Koch <konqueror@gmx.de>

       * java/io/FileDescriptor.java
       (SYNC): New constant.
       (DSYNC): Likewise.
[...]

broke bootstrap on *-*-freebsd[45].  FreeBSD 5 does support O_SYNC but
not O_DSYNC.  FreeBSD 4 supports neither.

I would prefer the patch submitter to fix the problem in some manner.
Otherwise, I'd ask whether I need to implement a simple guard around
the use of these macros in java/io/natFileDescriptorPosix.cc, or
whether we need to throw an implementation error when SYNC/DSYNC was
requested at the "java layer" but there was no system support for it.

I have this one for darwin, it may also be valid for *BSD? Not reg tested yet.

Andreas

RCS file: /cvs/gcc/gcc/libjava/include/posix.h,v
retrieving revision 1.18
diff -u -r1.18 posix.h
--- include/posix.h     22 Mar 2003 10:56:44 -0000      1.18
+++ include/posix.h     16 May 2003 04:01:56 -0000
@@ -48,6 +48,13 @@
 #define _Jv_platform_solib_suffix ".so"
 #endif

+// Darwin doesn't have O_SYNC and O_DYSNC so we define it here.
+// Needed in java/io/natFileDescriptorPosix.cc.
+#if defined(__APPLE__) && defined(__MACH__)
+#define O_SYNC O_FSYNC
+#define O_DSYNC O_FSYNC
+#endif
+
 // Separator for file name components.
 #define _Jv_platform_file_separator ((jchar) '/')
 // Separator for path components.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]