Peter Eisentraut <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly