Bug 22635

Summary: Why don't you use truncate(2) in libI77
Product: Base System Reporter: kkanda <kkanda>
Component: gnuAssignee: Ceri Davies <ceri>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-RELEASE   
Hardware: Any   
OS: Any   

Description kkanda 2000-11-06 09:30:00 UTC
LibI77 contains the truncation operation of files.
Although FreeBSD has truncate(2) system call, the routine 
"t_runc" in endfile.c uses the copy-delete-recopy 
algorithm for file size truncation. This sometimes causes
not only the lower performance but also the file system full.
So the executables using f77(=g77) can not deal with a large
sequential files which appear in large quantum chemistry,
for example.
"t_runc" routine seems to be used in backspace, close,
endfile and rewind operations.
"The Design and Implementation of the 4.4BSD" said that
truncate(2) was introduced for Fortran's file operation.:-)

How-To-Repeat: The following fortran code causes file system full
if the available disk space is smaller than 16MB.

      parameter (MX=1024*1024+1)
      real*8 a(MX)
      do i=1,MX
        a(i)=i
      enddo
      write(1)(a(i),i=1,MX)
      write(6,*)"write long file on 1"
      rewind 1
      write(6,*)"rewind 1"
      write(1)(a(i),i=1,MX-1)
      write(6,*)"write short file on 1"
      rewind 1
      write(6,*)"rewind 1"
      stop
      end
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-11-24 15:51:29 UTC
State Changed
From-To: open->closed
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-11-24 15:53:25 UTC
State Changed
From-To: closed->open

Closed in error.  I thought it was GNU software, then realized that 
it isn't.  Doesn't this package have a 3rd-party maintainer?
Comment 3 iedowse freebsd_committer freebsd_triage 2002-08-11 22:37:30 UTC
State Changed
From-To: open->feedback


Is this problem still present in more recent releases?
Comment 4 Ceri Davies freebsd_committer freebsd_triage 2003-06-08 19:01:03 UTC
State Changed
From-To: feedback->closed

Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates. 


Comment 5 Ceri Davies freebsd_committer freebsd_triage 2003-06-08 19:01:03 UTC
Responsible Changed
From-To: freebsd-bugs->ceri

Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates.