+2004-07-14 Bryce McKinlay <mckinlay@redhat.com>
+
+ PR libgcj/16204
+ * Makefile.am (AM_CXXFLAGS): Add -D_FILE_OFFSET_BITS=64 to enable
+ large file support.
+ * Makefile.in: Rebuilt.
+ * testsuite/libjava.lang/LargeFile.java: New test case.
+ * testsuite/libjava.lang/LargeFile.out: New file.
+
2004-07-14 Jerry Quinn <jlquinn@optonline.net>
* java/beans/EventHandler.java: Remove debugging statements.
-fdollars-in-identifiers \
## Detect bugs in the verifier implementation, and maybe other places.
-Wswitch-enum \
+## Some systems, including Linux, need this to enable > 2GB file support.
+ -D_FILE_OFFSET_BITS=64 \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
-DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
-DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\"" \
AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions $(THREADCXXFLAGS) \
-fdollars-in-identifiers \
-Wswitch-enum \
+ -D_FILE_OFFSET_BITS=64 \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
-DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
-DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\"" \
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
--- /dev/null
+/* Test to ensure files >= 2^31 bytes are supported. */
+
+import java.io.*;
+
+public class LargeFile
+{
+ public static void main(String[] args) throws IOException
+ {
+ File file = new File("LargeFile.tmp");
+
+ try
+ {
+ RandomAccessFile rfile = new RandomAccessFile(file, "rw");
+
+ long pos = (long) Math.pow(2, 31);
+
+ rfile.seek(pos);
+ rfile.write('O');
+ rfile.write('K');
+ rfile.close();
+
+ // Re-open, read byte back using FileInputStream and clean up.
+
+ FileInputStream fis = new FileInputStream(file);
+ fis.skip(pos);
+ System.out.print((char) fis.read());
+ System.out.println((char) fis.read());
+ fis.close();
+ }
+ finally
+ {
+ if (file.exists())
+ file.delete();
+ }
+ }
+}