[MLton] cvs commit: Added support for files larger than 2G

sweeks@mlton.org sweeks@mlton.org
Thu, 4 Dec 2003 14:42:21 -0800


sweeks      03/12/04 14:42:10

  Modified:    basis-library/integer patch.sml
               basis-library/io bin-or-text-io.fun
               basis-library/misc primitive.sml
               basis-library/posix error.sig error.sml file-sys.sml io.sml
                        primitive.sml
               benchmark main.sml
               doc      changelog
               lib/mlton/basic file.sig
               lib/mlton-stubs-in-smlnj int-inf.sml other.sml
               runtime  Makefile mlton-posix.h types.h
               runtime/Posix/FileSys Stat.c ftruncate.c open.c
               runtime/Posix/IO FLock.c lseek.c
  Log:
  MAIL Added support for files larger than 2G
  
  This included changing Position from Int32 to Int64.  It was
  surprisingly easy to make the needed changes to the basis library.
  The runtime was also pretty easy to update.  Now we compile with
  -D_FILE_OFFSET_BITS=64 instead of -D_LARGEFILE64_SOURCE.  I added a
  new typedef for Position as Int64, and updated the few routines that
  need to use Position instead of Int (stat, lseek, ...).
  
  Everything works on Linux.  I'll run tests on other platforms soon.
  
  If people have some real apps that use 64 bit file offsets, I'd
  appreciate some testing.

Revision  Changes    Path
1.13      +4 -1      mlton/basis-library/integer/patch.sml

Index: patch.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/patch.sml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- patch.sml	11 Sep 2003 19:46:49 -0000	1.12
+++ patch.sml	4 Dec 2003 22:42:08 -0000	1.13
@@ -14,6 +14,7 @@
       val fromLarge = fromInt o IntInf.toInt
       val toLarge = IntInf.fromInt o toInt
    end
+
 structure Int16: INTEGER_EXTRA =
    struct
       open Int16
@@ -21,6 +22,7 @@
       val fromLarge = fromInt o IntInf.toInt
       val toLarge = IntInf.fromInt o toInt
    end
+
 structure Int32: INTEGER_EXTRA =
    struct
       open Int32
@@ -28,6 +30,7 @@
       val fromLarge = IntInf.toInt
       val toLarge = IntInf.fromInt
    end
+
 structure Int64: INTEGER_EXTRA =
    struct
       open Int64
@@ -52,7 +55,7 @@
    end
 
 structure Int = Int32
-structure Position = Int
+structure Position = Int64
 structure FixedInt = Int
 
 structure Word8: WORD_EXTRA =



1.8       +2 -2      mlton/basis-library/io/bin-or-text-io.fun

Index: bin-or-text-io.fun
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/io/bin-or-text-io.fun,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- bin-or-text-io.fun	25 Sep 2003 01:43:25 -0000	1.7
+++ bin-or-text-io.fun	4 Dec 2003 22:42:08 -0000	1.8
@@ -161,7 +161,7 @@
 					       cause = exn})
       end
 
-fun getPosOut(out as ref (Out {fd, bufStyle, ...})) =
+fun getPosOut (out as ref (Out {fd, bufStyle, ...})) =
    let
       val streamPos = Posix.IO.lseek (fd, 0, Posix.IO.SEEK_CUR)
       val bufPos =
@@ -170,7 +170,7 @@
 	  | Buffered (Buf {size, ...}) => !size
 	  | Line (Buf {size, ...}) => !size
    in
-      streamPos + bufPos
+      Position.+ (streamPos, Position.fromInt bufPos)
    end
 
 val newOut =



1.90      +2 -0      mlton/basis-library/misc/primitive.sml

Index: primitive.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/misc/primitive.sml,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- primitive.sml	2 Dec 2003 03:59:07 -0000	1.89
+++ primitive.sml	4 Dec 2003 22:42:08 -0000	1.90
@@ -100,6 +100,8 @@
    struct
       type t = Word32.word
    end
+
+structure Position = Int64
    
 exception Bind = Bind
 exception Fail of string



1.3       +4 -2      mlton/basis-library/posix/error.sig

Index: error.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/posix/error.sig,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- error.sig	24 Nov 2002 01:19:39 -0000	1.2
+++ error.sig	4 Dec 2003 22:42:09 -0000	1.3
@@ -64,8 +64,10 @@
       val raiseSys: syserror -> 'a
 	 
       (* raises SysErr with ERRNO *)
-      val checkResult: int -> unit (* raiseSys if arg is -1 *)
-      val checkReturnResult: int -> int (* raiseSys if arg is -1 *)
+      (* raiseSys if arg is -1 *)
+      val checkResult: int -> unit
+      val checkReturnResult: int -> int 
+      val checkReturnPosition: Position.int -> Position.int
       val getErrno: unit -> int
       val clearErrno: unit -> unit
       val error: unit -> 'a



1.5       +2 -0      mlton/basis-library/posix/error.sml

Index: error.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/posix/error.sml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- error.sml	1 Dec 2003 18:22:17 -0000	1.4
+++ error.sml	4 Dec 2003 22:42:09 -0000	1.5
@@ -35,5 +35,7 @@
       fun raiseSys n = raise SysErr (errorMsg n, SOME n)
       fun error () = raiseSys (getErrno ())
       fun checkReturnResult (n: int) = if n = ~1 then error () else n
+      fun checkReturnPosition (n: Position.int) =
+	 if n = ~1 then error () else n
       fun checkResult n = (checkReturnResult n; ())
    end



1.10      +1 -1      mlton/basis-library/posix/file-sys.sml

Index: file-sys.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/posix/file-sys.sml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- file-sys.sml	1 Dec 2003 18:22:17 -0000	1.9
+++ file-sys.sml	4 Dec 2003 22:42:09 -0000	1.10
@@ -227,7 +227,7 @@
 		     nlink: int,
 		     uid: uid,
 		     gid: gid,
-		     size: int,
+		     size: Position.int,
 		     atime: Time.time,
 		     mtime: Time.time,
 		     ctime: Time.time}



1.10      +5 -2      mlton/basis-library/posix/io.sml

Index: io.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/posix/io.sml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- io.sml	26 Sep 2003 05:21:08 -0000	1.9
+++ io.sml	4 Dec 2003 22:42:09 -0000	1.10
@@ -127,7 +127,7 @@
 		   else raise Fail "Posix.IO.intToWhence"
 		      
       fun lseek (FD fd, n: Position.int, w: whence): Position.int =
-	 checkReturnResult (Prim.lseek (fd, n, whenceToInt w))
+	 Error.checkReturnPosition (Prim.lseek (fd, n, whenceToInt w))
 	 
       fun fsync (FD fd): unit = checkResult (Prim.fsync fd)
 	 
@@ -272,7 +272,10 @@
 		  if isReg fd
 		    then fn () => if !closed 
 				    then SOME 0
-				    else SOME(Position.-(FS.ST.size(FS.fstat fd), !pos))
+				    else SOME (Position.toInt
+					       (Position.-
+						(FS.ST.size (FS.fstat fd),
+						 !pos)))
 		    else fn () => if !closed then SOME 0 else NONE
 	      in
 		RD {avail = avail,



1.18      +12 -7     mlton/basis-library/posix/primitive.sml

Index: primitive.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/posix/primitive.sml,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- primitive.sml	1 Dec 2003 18:22:17 -0000	1.17
+++ primitive.sml	4 Dec 2003 22:42:09 -0000	1.18
@@ -389,7 +389,8 @@
 		  val nlink = _import "Posix_FileSys_Stat_nlink": unit -> int;
 		  val uid = _import "Posix_FileSys_Stat_uid": unit -> uid;
 		  val gid = _import "Posix_FileSys_Stat_gid": unit -> gid;
-		  val size = _import "Posix_FileSys_Stat_size": unit -> int;
+		  val size =
+		     _import "Posix_FileSys_Stat_size": unit -> Position.int;
 		  val atime =
 		     _import "Posix_FileSys_Stat_atime": unit -> time;
 		  val mtime =
@@ -427,7 +428,7 @@
 	    val fpathconf =
 	       _import "Posix_FileSys_fpathconf": fd * int -> int;
 	    val ftruncate =
-	       _import "Posix_FileSys_ftruncate": fd * int -> int;
+	       _import "Posix_FileSys_ftruncate": fd * Position.int -> int;
 	    val getcwd =
 	       _import "Posix_FileSys_getcwd": char array * size -> cstring;
 	    val link =
@@ -501,15 +502,18 @@
 		  val fcntl = _import "Posix_IO_FLock_fcntl": fd * int -> int;
 		  val typ = _import "Posix_IO_FLock_typ": unit -> int;
 		  val whence = _import "Posix_IO_FLock_whence": unit -> int;
-		  val start = _import "Posix_IO_FLock_start": unit -> int;
-		  val len = _import "Posix_IO_FLock_len": unit -> int;
+		  val start =
+		     _import "Posix_IO_FLock_start": unit -> Position.int;
+		  val len =
+		     _import "Posix_IO_FLock_len": unit -> Position.int;
 		  val pid = _import "Posix_IO_FLock_pid": unit -> int;
 		  val setType = _import "Posix_IO_FLock_setType": int -> unit;
 		  val setWhence =
 		     _import "Posix_IO_FLock_setWhence": int -> unit;
 		  val setStart =
-		     _import "Posix_IO_FLock_setStart": int -> unit;
-		  val setLen = _import "Posix_IO_FLock_setLen": int -> unit;
+		     _import "Posix_IO_FLock_setStart": Position.int -> unit;
+		  val setLen =
+		     _import "Posix_IO_FLock_setLen": Position.int -> unit;
 		  val setPid = _import "Posix_IO_FLock_setPid": int -> unit;
 	       end
 	    
@@ -519,7 +523,8 @@
 	    val fcntl2 = _import "Posix_IO_fcntl2": fd * int -> int;
 	    val fcntl3 = _import "Posix_IO_fcntl3": fd * int * int -> int;
 	    val fsync = _import "Posix_IO_fsync": fd -> int;
-	    val lseek = _import "Posix_IO_lseek": fd * int * int -> int;
+	    val lseek =
+	       _import "Posix_IO_lseek": fd * Position.int * int -> Position.int;
 	    val pipe = _import "Posix_IO_pipe": fd array -> int;
 	    val readChar = _import "Posix_IO_read":
 	       fd * char array * int * size -> ssize;



1.37      +5 -4      mlton/benchmark/main.sml

Index: main.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/benchmark/main.sml,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- main.sml	11 Sep 2003 20:32:02 -0000	1.36
+++ main.sml	4 Dec 2003 22:42:09 -0000	1.37
@@ -158,7 +158,7 @@
 	     then
 		let 
 		   val {text, data, ...} = Process.size exe
-		in SOME (text + data)
+		in SOME (Position.fromInt (text + data))
 		end
 	  else SOME (File.size exe)
        val run =
@@ -319,7 +319,7 @@
 		      abbrv: string,
 		      test: {bench: File.t} -> {compile: real option,
 						run: real option,
-						size: int option}} list ref 
+						size: Position.int option}} list ref 
 	= ref []
       fun pushCompiler compiler = List.push(compilers, compiler)
       fun pushCompilers compilers' = compilers := (List.rev compilers') @ (!compilers)
@@ -433,6 +433,7 @@
 		  end
 	       fun r2s r = Real.format (r, Real.Format.fix (SOME 2))
 	       val i2s = Int.toCommaString
+	       val p2s = i2s o Position.toInt
 	       val s2s = fn s => s
 	       val failures = ref []
 	       fun show ({compiles, runs, sizes, errs, outs}, {showAll}) =
@@ -545,7 +546,7 @@
 				NONE => ~1.0
 			      | SOME {value = v, ...} => value / v} :: ac)
 		     val _ = show ("run time ratio", ratios, r2s)
-		     val _ = show ("size", sizes, i2s)
+		     val _ = show ("size", sizes, p2s)
 		     val _ = show ("compile time", compiles, r2s)
 		     val _ = show ("run time", runs, r2s)
 		     val _ = case !outData of
@@ -576,7 +577,7 @@
 			 (compilers, ac, fn ({name, abbrv, test},
 					     ac as {compiles: real data,
 						    runs: real data,
-						    sizes: int data,
+						    sizes: Position.int data,
 						    outs: string data,
 						    errs: string data}) =>
 			  if true



1.91      +4 -0      mlton/doc/changelog

Index: changelog
===================================================================
RCS file: /cvsroot/mlton/mlton/doc/changelog,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- changelog	2 Dec 2003 01:47:02 -0000	1.90
+++ changelog	4 Dec 2003 22:42:09 -0000	1.91
@@ -1,5 +1,9 @@
 Here are the changes since version 20030716.
 
+* 2003-12-04
+  - Added support for files larger than 2G.  This included changing
+    Position from Int32 to Int64.
+
 * 2003-12-01
   - Added structure MLton.Pointer, which includes a type t for
     pointers (memory addresses, not SML heap pointers) and operations 



1.6       +1 -1      mlton/lib/mlton/basic/file.sig

Index: file.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/lib/mlton/basic/file.sig,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- file.sig	28 Jan 2003 05:17:06 -0000	1.5
+++ file.sig	4 Dec 2003 22:42:10 -0000	1.6
@@ -39,7 +39,7 @@
       val outputContents: t * Out.t -> unit
       val remove: t -> unit
       val sameContents: t * t -> bool
-      val size: t -> int
+      val size: t -> Position.int
       val suffix: t -> string option
       val temp: {prefix: string, suffix: string} -> t * Out.t
       val toString: t -> string



1.5       +1 -0      mlton/lib/mlton-stubs-in-smlnj/int-inf.sml

Index: int-inf.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/lib/mlton-stubs-in-smlnj/int-inf.sml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- int-inf.sml	12 Sep 2003 01:00:21 -0000	1.4
+++ int-inf.sml	4 Dec 2003 22:42:10 -0000	1.5
@@ -84,3 +84,4 @@
 
 structure Int32 = Int
 
+structure Position = Int



1.4       +0 -1      mlton/lib/mlton-stubs-in-smlnj/other.sml

Index: other.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/lib/mlton-stubs-in-smlnj/other.sml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- other.sml	12 Sep 2003 01:00:21 -0000	1.3
+++ other.sml	4 Dec 2003 22:42:10 -0000	1.4
@@ -10,7 +10,6 @@
 structure Option = Option
 structure Pack32Big = Pack32Big
 structure Pack32Little = Pack32Little
-structure Position = Position
 structure SML90 = SML90
 structure SMLofNJ = SMLofNJ
 structure Unix = Unix



1.76      +1 -1      mlton/runtime/Makefile

Index: Makefile
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Makefile,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- Makefile	29 Nov 2003 09:33:24 -0000	1.75
+++ Makefile	4 Dec 2003 22:42:10 -0000	1.76
@@ -17,7 +17,7 @@
 FLAGS += -b $(TARGET)
 endif
 
-CC = gcc -Wall -I. -Igdtoa -D_LARGEFILE64_SOURCE $(FLAGS)
+CC = gcc -Wall -I. -Igdtoa -D_FILE_OFFSET_BITS=64 $(FLAGS)
 CFLAGS = -O2
 DEBUGFLAGS = -gstabs+ -g2
 



1.7       +7 -7      mlton/runtime/mlton-posix.h

Index: mlton-posix.h
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/mlton-posix.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mlton-posix.h	10 Sep 2002 16:08:05 -0000	1.6
+++ mlton-posix.h	4 Dec 2003 22:42:10 -0000	1.7
@@ -52,7 +52,7 @@
 Word Posix_FileSys_Stat_uid ();
 Word Posix_FileSys_Stat_gid ();
 Word Posix_FileSys_Stat_rdev ();
-Int Posix_FileSys_Stat_size ();
+Position Posix_FileSys_Stat_size ();
 Int Posix_FileSys_Stat_atime ();
 Int Posix_FileSys_Stat_mtime ();
 Int Posix_FileSys_Stat_ctime ();
@@ -68,7 +68,7 @@
 Int Posix_FileSys_fchmod (Fd f, Mode m);
 Int Posix_FileSys_fchown (Fd f, Uid u, Gid g);
 Int Posix_FileSys_fpathconf (Fd f, Int n);
-Int Posix_FileSys_ftruncate (Fd f, Int n);
+Int Posix_FileSys_ftruncate (Fd f, Position n);
 Cstring Posix_FileSys_getcwd (Pointer buf, Size n);
 Int Posix_FileSys_link (NullString p1, NullString p2);
 Int Posix_FileSys_mkdir (NullString p, Word w);
@@ -97,13 +97,13 @@
 Int Posix_IO_FLock_fcntl (Fd f, Int cmd);
 Int Posix_IO_FLock_type ();
 Int Posix_IO_FLock_whence ();
-Int Posix_IO_FLock_start ();
-Int Posix_IO_FLock_len ();
+Position Posix_IO_FLock_start ();
+Position Posix_IO_FLock_len ();
 Int Posix_IO_FLock_pid ();
 void Posix_IO_FLock_setType (Int x);
 void Posix_IO_FLock_setWhence (Int x);
-void Posix_IO_FLock_setStart (Int x);
-void Posix_IO_FLock_setLen (Int x);
+void Posix_IO_FLock_setStart (Position x);
+void Posix_IO_FLock_setLen (Position x);
 void Posix_IO_FLock_setPid (Int x);
 
 Int Posix_IO_close (Fd f);
@@ -112,7 +112,7 @@
 Int Posix_IO_fcntl2 (Fd f, Int i);
 Int Posix_IO_fcntl3 (Fd f, Int i, Int j);
 Int Posix_IO_fsync (Fd f);
-Int Posix_IO_lseek (Fd f, Int i, Int j);
+Position Posix_IO_lseek (Fd f, Position i, Int j);
 Int Posix_IO_pipe (Pointer fds);
 Ssize Posix_IO_read (Fd fd, Pointer b, Int i, Size s);
 Ssize Posix_IO_write (Fd fd, Pointer b, Int i, Size s);



1.4       +1 -0      mlton/runtime/types.h

Index: types.h
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/types.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- types.h	24 Jun 2003 22:58:39 -0000	1.3
+++ types.h	4 Dec 2003 22:42:10 -0000	1.4
@@ -17,6 +17,7 @@
 typedef Real64 Real;
 typedef Word8 Char;
 typedef Word32 Word;
+typedef Int64 Position;
 
 typedef Int Bool;
 



1.2       +21 -17    mlton/runtime/Posix/FileSys/Stat.c

Index: Stat.c
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Posix/FileSys/Stat.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Stat.c	18 Jul 2001 05:51:06 -0000	1.1
+++ Stat.c	4 Dec 2003 22:42:10 -0000	1.2
@@ -2,60 +2,64 @@
 #include <unistd.h>
 #include "mlton-posix.h"
 
+#include <stdio.h>
+
 static struct stat statbuf;
 
-Word Posix_FileSys_Stat_dev() {
+Word Posix_FileSys_Stat_dev () {
 	return statbuf.st_dev;
 }
 
-Int Posix_FileSys_Stat_ino() {
+Int Posix_FileSys_Stat_ino () {
 	return statbuf.st_ino;
 }
 
-Word Posix_FileSys_Stat_mode() {
+Word Posix_FileSys_Stat_mode () {
 	return statbuf.st_mode;
 }
 
-Int Posix_FileSys_Stat_nlink() {
+Int Posix_FileSys_Stat_nlink () {
 	return statbuf.st_nlink;
 }
 
-Word Posix_FileSys_Stat_uid() {
+Word Posix_FileSys_Stat_uid () {
 	return statbuf.st_uid;
 }
 
-Word Posix_FileSys_Stat_gid() {
+Word Posix_FileSys_Stat_gid () {
 	return statbuf.st_gid;
 }
 
-Word Posix_FileSys_Stat_rdev() {
+Word Posix_FileSys_Stat_rdev () {
 	return statbuf.st_rdev;
 }
 
-Int Posix_FileSys_Stat_size() {
+Position Posix_FileSys_Stat_size () {
 	return statbuf.st_size;
 }
 
-Int Posix_FileSys_Stat_atime() {
+Int Posix_FileSys_Stat_atime () {
 	return statbuf.st_atime;
 }
 
-Int Posix_FileSys_Stat_mtime() {
+Int Posix_FileSys_Stat_mtime () {
 	return statbuf.st_mtime;
 }
 
-Int Posix_FileSys_Stat_ctime() {
+Int Posix_FileSys_Stat_ctime () {
 	return statbuf.st_ctime;
 }
 
-Int Posix_FileSys_Stat_fstat(Fd f) {
-	return fstat(f, &statbuf);
+Int Posix_FileSys_Stat_fstat (Fd f) {
+	return fstat (f, &statbuf);
 }
 
-Int Posix_FileSys_Stat_lstat(NullString f) {
-	return lstat((char*)f, &statbuf);
+Int Posix_FileSys_Stat_lstat (NullString f) {
+	return lstat ((char*)f, &statbuf);
 }
 
-Int Posix_FileSys_Stat_stat(NullString f) {
-	return stat((char*)f, &statbuf);
+Int Posix_FileSys_Stat_stat (NullString f) {	
+	Int res;
+
+	return stat ((char*)f, &statbuf);
 }



1.2       +2 -2      mlton/runtime/Posix/FileSys/ftruncate.c

Index: ftruncate.c
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Posix/FileSys/ftruncate.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ftruncate.c	18 Jul 2001 05:51:06 -0000	1.1
+++ ftruncate.c	4 Dec 2003 22:42:10 -0000	1.2
@@ -1,6 +1,6 @@
 #include <unistd.h>
 #include "mlton-posix.h"
 
-Int Posix_FileSys_ftruncate(Fd f, Int n) {
-	return ftruncate(f, n);
+Int Posix_FileSys_ftruncate (Fd f, Position n) {
+	return ftruncate (f, n);
 }



1.10      +1 -6      mlton/runtime/Posix/FileSys/open.c

Index: open.c
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Posix/FileSys/open.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- open.c	18 Nov 2003 23:43:15 -0000	1.9
+++ open.c	4 Dec 2003 22:42:10 -0000	1.10
@@ -8,17 +8,12 @@
 	DEBUG = 0,
 };
 
-/* {Free,Net}BSD use 64 bits files by default, so doesn't have O_LARGEFILE. */
-#if (defined (__FreeBSD__) || defined (__NetBSD__))
-#define O_LARGEFILE 0
-#endif
-
 Int Posix_FileSys_open (NullString p, Word w, Mode m) {
 	Int res;
 
 #if (defined (__FreeBSD__) || defined (__linux__) || defined (__NetBSD__) || defined (__sun__))
 
-	res = open ((char *) p, w | O_LARGEFILE, m);
+	res = open ((char *) p, w, m);
 
 #elif (defined (__CYGWIN__))
 



1.4       +4 -4      mlton/runtime/Posix/IO/FLock.c

Index: FLock.c
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Posix/IO/FLock.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FLock.c	12 May 2003 19:47:04 -0000	1.3
+++ FLock.c	4 Dec 2003 22:42:10 -0000	1.4
@@ -16,11 +16,11 @@
 	return s_flock.l_whence;
 }
 
-Int Posix_IO_FLock_start () {
+Position Posix_IO_FLock_start () {
 	return s_flock.l_start;
 }
 
-Int Posix_IO_FLock_len () {
+Position Posix_IO_FLock_len () {
 	return s_flock.l_len;
 }
 
@@ -36,11 +36,11 @@
 	s_flock.l_whence = x;
 } 
 
-void Posix_IO_FLock_setStart (Int x) {
+void Posix_IO_FLock_setStart (Position x) {
 	s_flock.l_start = x;
 } 
 
-void Posix_IO_FLock_setLen (Int x) {
+void Posix_IO_FLock_setLen (Position x) {
 	s_flock.l_len = x;
 } 
 



1.3       +1 -1      mlton/runtime/Posix/IO/lseek.c

Index: lseek.c
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Posix/IO/lseek.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- lseek.c	12 May 2003 19:47:04 -0000	1.2
+++ lseek.c	4 Dec 2003 22:42:10 -0000	1.3
@@ -2,6 +2,6 @@
 #include <unistd.h>
 #include "mlton-posix.h"
 
-Int Posix_IO_lseek (Fd f, Int i, Int j) {
+Position Posix_IO_lseek (Fd f, Position i, Int j) {
 	return lseek (f, i, j);
 }