libgcj does not appear to support files > 2GB. However the Sun implementation works fine on the same system & file system. The attached test case fails with the following error: $ gij LargeFile Exception in thread "main" java.io.IOException: Invalid argument at gnu.java.nio.channels.FileChannelImpl.seek(long) (/local/gcc-clean/lib/libgcj.so.6.0.0) at gnu.java.nio.channels.FileChannelImpl.position(long) (/local/gcc-clean/lib/libgcj.so.6.0.0) at java.io.RandomAccessFile.seek(long) (/local/gcc-clean/lib/libgcj.so.6.0.0) It appears we need to enable LFS support. see: http://www.suse.de/~aj/linux_lfs.html
Created attachment 6631 [details] Test case
I should note on sane OS's (all *BSD [Darwin is included]) offset_t is always 64bit.
Subject: Bug 16204 CVSROOT: /cvs/gcc Module name: gcc Changes by: bryce@gcc.gnu.org 2004-07-15 00:58:41 Modified files: libjava : ChangeLog Makefile.am Makefile.in Added files: libjava/testsuite/libjava.lang: LargeFile.java LargeFile.out Log message: 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. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.2932&r2=1.2933 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.am.diff?cvsroot=gcc&r1=1.388&r2=1.389 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.in.diff?cvsroot=gcc&r1=1.412&r2=1.413 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/LargeFile.java.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/LargeFile.out.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fix committed to HEAD.