Re: [GENERAL] Linux Largefile Support In Postgresql RPMS

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] Linux Largefile Support In Postgresql RPMS
Date: 2002-08-13 19:53:35
Message-ID: Pine.LNX.4.44.0208132000390.9559-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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(at)gmx(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2002-08-13 19:53:43 Re: [GENERAL] Linux Largefile Support In Postgresql RPMS
Previous Message Justin Clift 2002-08-13 19:44:08 Re: O'Reilly Open Source Convention Report

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-08-13 19:53:43 Re: [GENERAL] Linux Largefile Support In Postgresql RPMS
Previous Message Peter Eisentraut 2002-08-13 19:53:22 Re: [COMMITTERS] pgsql-server/src