diff -aur apr-original/configure.in apr-modified/configure.in
--- apr-original/configure.in	2004-10-14 00:55:27.000000000 +0200
+++ apr-modified/configure.in	2005-06-05 17:21:31.000000000 +0200
@@ -33,6 +33,14 @@
 echo "Configuring APR library"
 echo "Platform: $host"
 
+dnl
+dnl largefile support hacks <curious@progsoc.org>
+dnl
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+LFSFLAGS=`getconf LFS_CFLAGS`
+CFLAGS="${CFLAGS=} $LFSFLAGS"
+
 dnl Some initial steps for configuration.  We setup the default directory
 dnl and which files are to be configured.
 
diff -aur apr-original/file_io/unix/seek.c apr-modified/file_io/unix/seek.c
--- apr-original/file_io/unix/seek.c	2004-10-14 00:55:27.000000000 +0200
+++ apr-modified/file_io/unix/seek.c	2005-06-06 13:03:57.147848232 +0200
@@ -15,9 +15,9 @@
 
 #include "apr_arch_file_io.h"
 
-static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
+static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
 {
-    long newbufpos;
+    apr_off_t newbufpos;
     int rc;
 
     if (thefile->direction == 1) {
@@ -50,7 +50,7 @@
 APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
 {
     apr_off_t rv;
-
+    
     thefile->eof_hit = 0;
 
     if (thefile->buffered) {
@@ -76,7 +76,6 @@
         *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
         return rc;
     } else {
-
         rv = lseek(thefile->filedes, *offset, where);
         if (rv == -1) {
             *offset = -1;
diff -aur apr-original/include/apr.h.in apr-modified/include/apr.h.in
--- apr-original/include/apr.h.in	2004-10-14 00:55:27.000000000 +0200
+++ apr-modified/include/apr.h.in	2005-06-04 22:41:24.000000000 +0200
@@ -265,7 +265,9 @@
 
 typedef  @size_t_value@          apr_size_t;
 typedef  @ssize_t_value@         apr_ssize_t;
-typedef  @off_t_value@           apr_off_t;
+// largefile support hacks - <curious@progsoc.org>
+// force export of 64 bit apr_off_t
+typedef  long long		 apr_off_t;
 typedef  @socklen_t_value@       apr_socklen_t;
 
 #define APR_SIZEOF_VOIDP @voidp_size@
diff -aur apr-original/include/arch/unix/apr_arch_file_io.h apr-modified/include/arch/unix/apr_arch_file_io.h
--- apr-original/include/arch/unix/apr_arch_file_io.h	2004-10-14 00:55:27.000000000 +0200
+++ apr-modified/include/arch/unix/apr_arch_file_io.h	2005-06-06 12:49:08.458949480 +0200
@@ -94,10 +94,10 @@
 
     /* Stuff for buffered mode */
     char *buffer;
-    int bufpos;               /* Read/Write position in buffer */
-    unsigned long dataRead;   /* amount of valid data read into buffer */
+    apr_off_t bufpos;               /* Read/Write position in buffer */
+    apr_off_t dataRead;   /* amount of valid data read into buffer */
     int direction;            /* buffer being used for 0 = read, 1 = write */
-    unsigned long filePtr;    /* position in file of handle */
+    apr_off_t filePtr;    /* position in file of handle */
 #if APR_HAS_THREADS
     struct apr_thread_mutex_t *thlock;
 #endif

