Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  6 Nov 2000 01:22:07 -0800 (PST)
From:      kkanda@rc.m-kagaku.co.jp
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   gnu/22635: Why don't you use truncate(2) in libI77
Message-ID:  <20001106092207.4A66437B4CF@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         22635
>Category:       gnu
>Synopsis:       Why don't you use truncate(2) in libI77
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 06 01:30:00 PST 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001106092207.4A66437B4CF>