This is the mail archive of the gcc-patches@gcc.gnu.org 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";
begin
  if (Is_Regular_File (Name)) then
     Put_Line ("largefile.tar is a regular file.");
  else
     Put_Line ("largefile.tar is not a regular file.");
  end if;

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

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

gingell@nile$ ./t
0
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  <gingell@adacore.com>

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

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]