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
Loren> * libjava/include/posix.h (O_SYNC): Define if not available
Loren> and a reasonable, perhaps more conservative, replacement exists.
Loren> (O_DSYNC): Likewise.
> Actually I prefer this to Michael's patch. Let's use this instead;
> please check it in. It is also ok to revert the commenting-out in
> natFileDescriptorPosix.cc.
[Tom, thanks for the CC.] As committed to mainline. Tested by
recompiling affected cc file in an already bootstrapped tree. (Note:
I've had the header change in my tree since I originally posted it.)
Regards,
Loren
+ * libjava/include/posix.h (O_SYNC): Define if not available
+ and a reasonable, perhaps more conservative, replacement exists.
+ (O_DSYNC): Likewise.
+ * java/io/natFileDescriptorPosix.cc (open): Revert last patch.
[cvs update -j1.27 -j1.26 libjava/java/io/natFileDescriptorPosix.cc]
Index: libjava/java/io/natFileDescriptorPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natFileDescriptorPosix.cc,v
retrieving revision 1.27
diff -c -r1.27 natFileDescriptorPosix.cc
*** libjava/java/io/natFileDescriptorPosix.cc 16 May 2003 08:09:32 -0000 1.27
--- libjava/java/io/natFileDescriptorPosix.cc 5 Jun 2003 22:30:38 -0000
***************
*** 105,117 ****
}
}
- /* FIXME: comment this out until its better tested/implemented
if ((jflags & SYNC))
flags |= O_SYNC;
if ((jflags & DSYNC))
flags |= O_DSYNC;
- */
int fd = ::open (buf, flags, mode);
if (fd == -1 && errno == EMFILE)
--- 105,115 ----
Index: libjava/include/posix.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix.h,v
retrieving revision 1.18
diff -c -r1.18 posix.h
*** libjava/include/posix.h 22 Mar 2003 10:56:44 -0000 1.18
--- libjava/include/posix.h 5 Jun 2003 22:30:38 -0000
***************
*** 48,53 ****
--- 48,62 ----
#define _Jv_platform_solib_suffix ".so"
#endif
+ // Some POSIX systems don't have O_SYNC and O_DYSNC so we define them here.
+ // Needed in java/io/natFileDescriptorPosix.cc.
+ #if !defined (O_SYNC) && defined (O_FSYNC)
+ #define O_SYNC O_FSYNC
+ #endif
+ #if !defined (O_DSYNC) && defined (O_FSYNC)
+ #define O_DSYNC O_FSYNC
+ #endif
+
// Separator for file name components.
#define _Jv_platform_file_separator ((jchar) '/')
// Separator for path components.