Re: [COMMITTERS] pgsql-server/src/include/port hpux.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql-server/src/include/port hpux.h
Date: 2002-09-04 16:32:40
Message-ID: 15070.1031157160@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> I found an HP whitepaper on the large file support and it seems they don't
> have the problem of missing declarations.
> http://docs.hp.com/hpux/onlinedocs/os/lgfiles4.pdf
> Note the example in section 6.4.1. On page 37 they grep the preprocessed
> source and somehow manage to get a declaration of __lseek64() in there.

Yeah, but you'll notice they *have to* declare __lseek64(), 'cause the
compiler will otherwise assume it returns int. I've been through these
files now and it seems that they've very carefully included only the
minimal declarations they absolutely had to. What's really annoying
is that the prototypes are there --- but #ifdef'd out of sight:

# if defined(_FILE64)
# ifndef __cplusplus
extern off_t __lseek64();
# ifdef __STDC_EXT__
static truncate(a,b) const char *a; off_t b; { return __truncate64(a,b); }
# else
static truncate(a,b) off_t b; { return __truncate64(a,b); }
# endif /* __STDC_EXT__ */
static int prealloc(a,b) off_t b; { return __prealloc64(a,b); }
static int lockf(a,b,c) off_t c; { return __lockf64(a,b,c); }
static int ftruncate(a,b) off_t b; { return __ftruncate64(a,b); }
static off_t lseek(a,b,c) off_t b; { return __lseek64(a,b,c); }
# else /* __cplusplus */
extern off_t __lseek64(int, off_t, int);
extern int __truncate64(const char *, off_t);
extern int __prealloc64(int, off_t);
extern int __lockf64(int, int, off_t);
extern int __ftruncate64(int, off_t);
inline int truncate(const char *a, off_t b) { return __truncate64(a,b); }
inline int prealloc(int a, off_t b) { return __prealloc64(a,b); }
inline int lockf(int a, int b, off_t c) { return __lockf64(a,b,c); }
inline int ftruncate(int a, off_t b) { return __ftruncate64(a,b); }
inline off_t lseek(int a, off_t b, int c) { return __lseek64(a,b,c); }
# endif /* __cplusplus */
# endif /* _FILE64 */

The bottom line is that large file support does work on HPUX 10.20, but
it will generate a ton of warning messages if you build using gcc and
-Wmissing-declarations.

I'm now thinking that I will just edit my local copies of the system
headers to add the missing declarations so that I don't see these
warnings. Turning off largefile support is probably too high a price
for users to pay just so Tom Lane doesn't have to see warnings ;-)

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2002-09-04 17:11:50 pgsql-server/. HISTORY
Previous Message Tom Lane 2002-09-04 15:45:50 pgsql-server/src backend/utils/mb/conversion_p ...

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-09-04 16:43:51 Re: findoidjoins
Previous Message Iavor Raytchev 2002-09-04 16:24:10 Re: pgaccess - where to store the own data