This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] improve handling of files larger than 2GB

Wherever we depend on stat for files larger than 2GB we get failures
or junk values. This impacts all kinds of stuff, for instance in this
TN the customer was seeing errors in Ada Directories.Search.

Here's a example of the problem:

with GNAT.IO; use GNAT.IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;

procedure T is
  Name : String := "largefile.tar";
  if (Is_Regular_File (Name)) then
     Put_Line ("largefile.tar is a regular file.");
     Put_Line ("largefile.tar is not a regular file.");
  end if;

  if (Is_Directory (Name)) then
    Put_Line ("largefile.tar is a directory.");
     Put_Line ("largefile.tar is not a directory.");
  end if;

  Put_Line (Locate_Regular_File (Name, ".").all);
end T;

gingell@nile$ ./t
largefile.tar is not a regular file.
largefile.tar is not a directory.
raised CONSTRAINT_ERROR : t.adb:25 access check failed

This patch solves the above problem.
Tested on x86_64-pc-linux-gnu, committed on trunk

2009-06-22  Matthew Gingell  <>

	* adaint.c, adaint.h, cstreams.c: Call stat64 on platforms where it is

Attachment: difs
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]