From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: GNAT Ada.Direct_IO bug Date: Sun, 7 Sep 2014 14:58:54 +0200 Organization: cbb software GmbH Message-ID: <9tf9x3eahm6h$.rh1bpbijiyjl.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: ZB2Fb2q1fa4xpMpNKFqV6Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:188905 Date: 2014-09-07T14:58:54+02:00 List-Id: I have verified this under Windows 7 64-bit (NTFS) and 32-bit Linux and Fedora. It seems that the implementation of GNAT Ada.Direct_IO is limited to 2Gb file sizes regardless that the underlying OS has no such constraint. Here is the test program: ------------------------------------------------------------ with Ada.Direct_IO; with Ada.Text_IO; use Ada.Text_IO; procedure Test_DIO is type Block is array (1..1024) of Character; for Block'Size use 1024*8; package DIO is new Ada.Direct_IO (Block); File : DIO.File_Type; Data : Block := (others => ' '); begin DIO.Create (File); for Giga in 1..2 loop for Mega in 1..1024 loop for Kilo in 1..1024 loop DIO.Write (File, Data); end loop; end loop; Put_Line ("File size" & DIO.Count'Image (DIO.Size (File)) & " Kbytes"); end loop; end Test_DIO; ------------------------------------------------------------- Under Windows [GNAT GPL gpl-2014 (20140405)] it silently wraps the file to zero size. So the output looks like: >test_dio.exe File size 1048576 Kbytes File size 0 Kbytes 32-bit Debian [4.9.1 (Debian 4.9.1-4)] exposes the same behavior as Windows. [64-bit Fedora and Debian work as expected] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de