Re: [GENERAL] Linux Largefile Support In Postgresql RPMS - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [GENERAL] Linux Largefile Support In Postgresql RPMS
Date
Msg-id Pine.LNX.4.44.0208132000390.9559-100000@localhost.localdomain
Whole thread Raw
In response to Re: [GENERAL] Linux Largefile Support In Postgresql RPMS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> > The prototype for fseek() is long int; I had assumed that off_t was not
> > defined if _LARGEFILE_SOURCE was not defined.

All that _LARGEFILE_SOURCE does is make fseeko() and ftello() visible on
some systems, but on some systems they should be available by default.

> Oh, you're right.  A quick look at HPUX shows it's the same way: ftell
> returns long int, ftello returns off_t (which presumably is an alias
> for long long int).  Okay, OFF_T seems a reasonable answer.

fseek() and ftell() using long int for the offset was a mistake, therefore
fseeko() and ftello() were invented.  (This is independent of whether the
large file interface is used.)

To activate the large file interface you define _FILE_OFFSET_BITS=64,
which transparently replaces off_t and everything that uses it with a 64
bit version.  There is no need to use any of the proposed macro tricks
(because that exact macro trick is already provided by the OS).

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [COMMITTERS] pgsql-server/src
Next
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] Linux Largefile Support In Postgresql RPMS