From nobody@FreeBSD.ORG  Mon Nov  6 01:22:07 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 4A66437B4CF; Mon,  6 Nov 2000 01:22:07 -0800 (PST)
Message-Id: <20001106092207.4A66437B4CF@hub.freebsd.org>
Date: Mon,  6 Nov 2000 01:22:07 -0800 (PST)
From: kkanda@rc.m-kagaku.co.jp
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Why don't you use truncate(2) in libI77
X-Send-Pr-Version: www-1.0

>Number:         22635
>Category:       gnu
>Synopsis:       Why don't you use truncate(2) in libI77
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ceri
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 06 01:30:00 PST 2000
>Closed-Date:    Sun Jun 08 11:01:05 PDT 2003
>Last-Modified:  Sun Jun 08 11:01:05 PDT 2003
>Originator:     Katsuya KANDA
>Release:        FreeBSD 4.1-RELEASE i386
>Organization:
Mitsubishi Chemical Corp.
>Environment:
FreeBSD izumo1 4.1-RELEASE FreeBSD 4.1-RELEASE #1: Tue Oct 10 20:24:40 JST 2000     katsuya@izumo1:/usr/src/sys/compile/IZUMO  i386

>Description:
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


>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Fri Nov 24 07:51:29 PST 2000 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=22635 
State-Changed-From-To: closed->open 
State-Changed-By: sheldonh 
State-Changed-When: Fri Nov 24 07:53:25 PST 2000 
State-Changed-Why:  
Closed in error.  I thought it was GNU software, then realized that 
it isn't.  Doesn't this package have a 3rd-party maintainer? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22635 
State-Changed-From-To: open->feedback 
State-Changed-By: iedowse 
State-Changed-When: Sun Aug 11 14:37:30 PDT 2002 
State-Changed-Why:  

Is this problem still present in more recent releases? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22635 
State-Changed-From-To: feedback->closed 
State-Changed-By: ceri 
State-Changed-When: Sun Jun 8 11:01:03 PDT 2003 
State-Changed-Why:  
Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates. 


Responsible-Changed-From-To: freebsd-bugs->ceri 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Sun Jun 8 11:01:03 PDT 2003 
Responsible-Changed-Why:  
Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22635 
>Unformatted:
