LFS fixes for MOL

Andreas Schwab mol-devel@lists.maconlinux.org
Mon, 10 Feb 2003 12:11:16 +0100


This patch makes it possible to compile MOL with LFS
(_FILE_OFFSET_BITS=64), which is needed when you want to use a disk image
bigger than 2GB.

Andreas.

--- configure.in
+++ configure.in
@@ -355,7 +355,7 @@
 ################################################################################
 
 AC_MSG_CHECKING([whether off_t is 64 bit])
-AC_TRY_RUN([ #include <unistd.h>
+AC_TRY_RUN([ #include <sys/types.h>
 	     int main( int argc, char **argv ) { return !(sizeof(off_t)==8); }
 ], OFFT64=yes, OFFT64=no, OFFT64=unknown )
 AC_MSG_RESULT($OFFT64)
--- src/include/llseek.h
+++ src/include/llseek.h
@@ -28,7 +28,7 @@
 long_lseek( int fd, ulong pos_hi, ulong pos_lo )
 {
 #ifdef OFF_T_IS_64
-	return lseek( fd, TO_LLONG( pos_hi, pos_lo), SEEK_SET );
+	return lseek( fd, TO_LLONG( pos_hi, pos_lo), SEEK_SET ) == -1 ? -1 : 0;
 #else
 	loff_t res;
 	return _llseek( fd, pos_hi, pos_lo, &res, SEEK_SET );
@@ -46,7 +46,7 @@
 		return -2;
 	}
 #ifdef OFF_T_IS_64
-	return lseek( fd, ((llong)block<<9) | offs, SEEK_SET );
+	return lseek( fd, ((llong)block<<9) | offs, SEEK_SET ) == -1 ? -1 : 0;
 #else
 	return _llseek( fd, (block>>23), (block<<9) | offs, &res, SEEK_SET );
 #endif

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."