Thread: stat64 support

  1. #1
    Registered User
    Join Date
    Jan 2009

    Post stat64 support


    I have found out that in order to use stat on a file over 2GB, I have to compile my program with large file support. Doing a `getconf LFS_CFLAGS` yields "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64". If I then compile with those flags, everything is great. Why doesn't configure and automake do this for me? I have an example of another program whos configure does it automatically, but it doesn't explicitly mention anything like AC_SYS_LARGEFILES. It does include some m4 functions that require AC_SYS_LARGEFILES. But shouldn't in this day and age I never have to mention anything? Or do I gave to go back and edit the configure script of every program I've ever made?


  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    Obviously, Autoconf, Automake and Configure scripts do what they have been told.

    So, if you need to have large-file support, or any other "specifics", you probably need to configure your automake, autoconf or configure scripts to take that into account.

    As to "do you need to go back and reconfigure every project", well, it obivously only matters if the application is sensibly going to be used with files larger than 2GB.

    [By the way, only the size is wrong in stat if you do it on a 2GB+ file - all other information still works right].

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. unicode support
    By herWter in forum Windows Programming
    Replies: 5
    Last Post: 07-09-2008, 12:27 PM
  3. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  4. Dev-cpp - compiler options
    By tretton in forum C Programming
    Replies: 7
    Last Post: 01-06-2006, 06:20 PM