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

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

From
Peter Eisentraut
Date:
Tom Lane writes:

> What I'm currently thinking we should do is default largefile support to
> off in HPUX < 11.0; is there a convenient way to accomplish that in
> autoconf?

Something like this maybe (before AC_SYS_LARGEFILE):

case $host_os in hpuxZYX*)
if test "${enable_largefile+set}" != set; then
enable_largefile=no
fi
esac

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.
Maybe it's a later OS release.

-- 
Peter Eisentraut   peter_e@gmx.net



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

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.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
intlockf(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);
externint __prealloc64(int, off_t);   extern int __lockf64(int, int, off_t);   extern int __ftruncate64(int, off_t);
inlineint 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(inta, 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