Index: detail/os_file_functions.hpp =================================================================== --- detail/os_file_functions.hpp (revision 83488) +++ detail/os_file_functions.hpp (working copy) @@ -25,6 +25,7 @@ # include #else # ifdef BOOST_HAS_UNISTD_H +# include // _LARGEFILE64_SOURCE # include # include # include @@ -367,12 +368,24 @@ bool is_xsi; } mapping_handle_t; + +// You need to define -D_FILE_OFFSET_BITS=64 +// for accessing large files on x32. +#if defined(_LARGEFILE64_SOURCE) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS==64 +typedef enum { read_only = O_RDONLY | O_LARGEFILE + , read_write = O_RDWR | O_LARGEFILE + , copy_on_write + , read_private + , invalid_mode = 0xffff + } mode_t; +#else typedef enum { read_only = O_RDONLY , read_write = O_RDWR , copy_on_write , read_private , invalid_mode = 0xffff } mode_t; +#endif typedef enum { file_begin = SEEK_SET , file_end = SEEK_END @@ -444,6 +457,9 @@ return ret; } +// You need to define -D_FILE_OFFSET_BITS=64 +// for accessing large files on x32 +// (requires _LARGEFILE64_SOURCE defined by system libraries). inline file_handle_t open_existing_file (const char *name, mode_t mode, bool temporary = false) {