Subject: Tcl7.5 and NetBSD-current
To: Aaron Brown <abrown@eecs.harvard.edu>
From: Bruce Albrecht <Bruce.Albrecht@seag.fingerhut.com>
List: current-users
Date: 02/26/1996 10:51:23
Aaron Brown writes:
 > Hi all,
 > 
 > I just tried to compile Tcl7.5b1 under NetBSD-current (24Feb SUP) (sparc) 
 > and although it compiled fine, it failed many of the file and I/O 
 > regression tests. From what I can tell, anything dealing with file size 
 > came out to be zero. This sounds like a problem with 64-bit file 
 > offsets...has anyone seen it or solved it before? I tried reading some of 
 > the tcl code, but I know so little about tcl that I wasn't successful in 
 > tracking it down...

I just posted a patch, and emailed to netbsd-help for this problem a
couple of days ago.  This only fixes the file size function.  Hume
Smith pointed out that there's probably still a problem with seeks,
probably for files over 4GB, but I wouldn't be able to test it.


diff  tclUnixAZ.c~ tclUnixAZ.c 
*** tclUnixAZ.c~        Wed Feb 21 15:00:43 1996
--- tclUnixAZ.c Wed Feb 21 15:12:37 1996
***************
*** 680,686 ****
        if (stat(fileName, &statBuf) == -1) {
            goto badStat;
        }
!       sprintf(interp->result, "%ld", statBuf.st_size);
        goto done;
      } else if ((c == 's') && (strncmp(argv[1], "stat", length) == 0)
            && (length >= 2)) {
--- 680,686 ----
        if (stat(fileName, &statBuf) == -1) {
            goto badStat;
        }
!       sprintf(interp->result, sizeof(statBuf.st_size)==8 ? "%qd" : "%ld", statBuf.st_size);
        goto done;
      } else if ((c == 's') && (strncmp(argv[1], "stat", length) == 0)
            && (length >= 2)) {
 	sprintf(interp->result, "%ld", statBuf.st_size);