This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: libjava/java/io/natFileDescriptorPosix.cc -r1.25 -r1.26
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Cc: java-patches at gcc dot gnu dot org, konqueror at gmx dot de
- Date: Fri, 16 May 2003 06:03:08 +0200
- Subject: Re: libjava/java/io/natFileDescriptorPosix.cc -r1.25 -r1.26
- References: <200305160337.h4G3bi94068078@latour.rsch.comm.mot.com>
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.