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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,bb0f9a9ffc9ae0e6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!l12g2000yqo.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Large files on 32 and 64 bits ystem Date: Tue, 26 May 2009 03:22:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2fe51a53-8dc1-4586-ad82-858cf35d7c69@l12g2000yqo.googlegroups.com> References: <4a1aedda$0$2855$ba620e4c@news.skynet.be> <93b17897-d40d-4c96-84a2-f0221a71843e@s28g2000vbp.googlegroups.com> <4a1b7ad2$0$2870$ba620e4c@news.skynet.be> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243333362 2574 127.0.0.1 (26 May 2009 10:22:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 May 2009 10:22:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l12g2000yqo.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6016 Date: 2009-05-26T03:22:42-07:00 List-Id: Olivier Scalbert wrote on comp.lang.ada: > Ludovic Brenta wrote: > > That line indicates that the GNAT run-time library delegates the write > > to fwrite(3), so your question really boils down to whether the C run- > > time library has support for large files or not. =A0What filesystem typ= e > > do you use on your machines? (I use XFS which supports files up to 8 > > exabytes :) ) > > I use ext3. In this filesystem, files can grow to 16 GiB to 2 TiB depending on block size. [1] explains how large file support works in GNU/Linux. Basically, a C program supports LFS if it is compiled with the -D_FILE_OFFSET_BITS=3D64 preprocessor option on the command line. This changes the definition of fopen(3), fwrite(3) et al to use 64-bit file offsets instead of the default 32-bit file offsets. Unfortunately, the GNAT run-time library directly imports these functions from glibc without any preprocessor in between, so is restricted to 32-bit file offsets, and so does not support large files. It would be an interesting project for a beginning GCC hacker to implement LFS in libgnat. This would involve: - wrapper functions in adaint.c that call fopen(3), fwrite(3), etc. - compiling adaint.c with -D_FILE_OFFSET_BITS=3D64 - calling the wrappers instead of the glibc functions in System.File_IO et al. (it may be a little bit tricky to import them properly on all platforms, with and without LFS). [1] http://www.suse.de/~aj/linux_lfs.html -- Ludovic Brenta.