Re: Large file support available - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Large file support available
Date
Msg-id Pine.LNX.4.44.0208212027550.1376-100000@localhost.localdomain
Whole thread Raw
In response to Re: Large file support available  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Large file support available  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> /usr/include/sys/resource.h: In function `getrlimit':
> /usr/include/sys/resource.h:168: warning: implicit declaration of function `__getrlimit64'
> /usr/include/sys/resource.h: In function `setrlimit':
> /usr/include/sys/resource.h:170: warning: implicit declaration of function `__setrlimit64'
>
> for essentially every file in the system.  A little digging shows that
> this is happening because _FILE64 is defined and _LARGEFILE64_SOURCE
> is not; this is evidently a Bad Idea on HPUX.

You're supposed to define _LARGEFILE64_SOURCE if you want to use functions
like open64(), fseek64(), getrlimit64(), etc. in your source.  We don't
want those, obviously.

What is happening here is that evidently the system headers effectively
redefine getrlimit() to point to getrlimit64() if FILE_OFFSET_BITS=64,
which is the usual strategy for all the I/O functions.  But you're not
supposed to have to define _LARGEFILE64_SOURCE for this, because the
change is supposed to be transparent.

If the {s|g}etrlimit warnings are indeed the only ones (i.e., none about
open, fseek, write, read, etc.) then this is either a bug or there's
something wrong in the include file order or something like that.  Which
way is sys/resource.h included anyway?

If there's no way to fix it then we can add a definition of
_LARGEFILE64_SOURCE to hpux.h and consider further action.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Large file support available
Next
From: Peter Eisentraut
Date:
Subject: Re: bison news