[Zlib-devel] zlib large file support

Mark Brown broonie at sirena.org.uk
Fri Dec 31 07:45:35 EST 2004


On Thu, Dec 30, 2004 at 10:53:21PM -0800, Mark Adler wrote:

> I understand that for Linux (some Linux? all Linux?) I need to have 
> these compile options: "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" to 

It's all 32 bit Linux and some other systems (64 bit Linux has the API
but it's less useful).

> enable 64-bit offsets and file access (this is for gzio/gzlib), e.g. a 
> 64-bit off_t type.  Maybe for some other systems as well.  (HP/UX?  
> Solaris?)  I'd like some help with how to handle this in configure and 

At least Solaris has them.  I don't off hand known about others.
There's a spec for the API at:

    http://ftp.sas.com/standards/large.file/x_open.20Mar96.html

(see section 3 for the #defines).  Note that there's two approaches to
using it: a transitional API which is defined in parallel to the
32 bit off_t and _FILE_OFFSET_BITS which can be used to redefine the
standard off_t to be 64 bit.

> Makefile.  Is there a way to know when to define these?  Thanks.

The getconf utility should provide defines for LFS:

    $ getconf LFS_CFLAGS
    -D_FILE_OFFSET_BITS=64

with similar defines for LFS_LDFLAGS and LFS_LIBS and LFS64_ versions of
all these for the transitional API.  The utility should return an error
if it hasn't heard of the variable or an empty string if that's the
appropriate response.

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."




More information about the Zlib-devel mailing list