It's time for 3.0.1
Nicholas Brealey
nick at brealey.org
Tue Dec 9 01:55:15 GMT 2003
Gerald (Jerry) Carter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> David Collier-Brown wrote:
> | David Collier-Brown wrote:
> |
> |>
> |> /* Whether off64_t is available */
> |> /* #undef HAVE_OFF64_T */
> |>
> |
> | An, indeed, when I run configure it says:
> | checking for off64_t... no
> ...
>
> | When run on my 64-bit Solaris machine , I get:
> | elsbeth> cc -o foo foo.c
> | "foo.c", line 7: warning: old-style declaration or incorrect type for:
> main
> | "foo.c", line 11: warning: implicit function declaration: exit
> | elsbeth> ./foo; echo $?
> | 0
> | elsbeth>
>
> This is what I get on Solaris 8 (gcc 2.95)
>
> configure:17767: checking for off64_t
> configure:17788: gcc -o conftest -Wall -g -D_LARGEFILE_SOURCE
> - -D_FILE_OFFSET_BITS=64
> ~ conftest.c -lsec -lgen -lresolv -lsocket -lnsl >&5
> configure:17783: warning: return-type defaults to `int'
> configure: In function `main':
> configure:17783: warning: unused variable `s'
> configure:17791: $? = 0
> configure:17793: ./conftest
> configure:17796: $? = 1
> configure: program exited with status 1
> configure: failed program was:
> #line 17776 "configure"
> #include "confdefs.h"
>
> #if defined(HAVE_UNISTD_H)
> #include <unistd.h>
> #endif
> #include <stdio.h>
> #include <sys/stat.h>
> main()
> {
> struct stat64 st;
> off64_t s;
> if (sizeof(off_t) == sizeof(off64_t))
> exit(1);
>
> exit((lstat64("/dev/null", &st)==0)?0:1);
>
> }
>
> configure:17809: result: no
>
> which makes sense since you say the following is in <stdio.h>
>
> typedef off_t off64_t;
>
I think that is correct. I think HAVE_OFF64_T really means:
'The compilation enviroment we are using has an off64_t type.'
It does not mean:
'An off64_t type is available in one of the compilation
environments available on this system.'
(man lfcompile and man lfcompile64 on Solaris.)
What is strange with Samba is that it is using both the
'large file compilation environment for 32-bit applications'
and the 'transitional compilation environment' at the same time:
I configured Samba 3.0.1rc1 on Solaris 9 with the Sun's C 5.5:
CC=cc ./configure --with-quotas
When I start making smaba I see:
Using FLAGS = (trimmed) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Having -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 look good - we can access large
files using standard names (fseeko, off_t is 64 bit etc).
What seems strange is that in config.h I see:
/* Whether to enable large file support */
#define _LARGEFILE64_SOURCE 1
Having _LARGEFILE64_SOURCE defined as well as
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 seems very strange to me.
Using #define _LARGEFILE64_SOURCE 1 makes the transistional interfaces like off64_t available,
but what is the point since off_t is already a 64 bit type? As I understand it one would normally
only use _LARGEFILE64_SOURCE if one needed to keep off_t etc as 32 bit types for compatabilty
with old code which casts off_t's to int's.
It seems to me that config.h should have #define _LARGEFILE_SOURCE 1 instead of
#define _LARGEFILE64_SOURCE 1 (which matches the compiler flags) and config.h should
define whatever HAVE_* flags are appropriate in this situtation:
i.e. HAVE_OFF64_T etc should NOT be defined.
Nick
More information about the samba-technical
mailing list