[Fwd: [Patch] Configure broken for Solaris 2.6 (PR#12014)]

Jeremy Allison jallison at cthulhu.engr.sgi.com
Thu Dec 17 18:36:02 GMT 1998

Andrej Borsenkow wrote:

> I don't know about Solaris, but LARGEFILE64_SOURCE and _FILE_OFFSET_BITS ==
> 64 _must_ be mutually incompatible. The former means, that you want off_t be
> 32 bit and explicitly use xxx64 versions of some functions and off64_t,
> ino64_t; the latter means, that off_t, ino_t etc are 64 bit long and you do
> _not_ want use xxx64 functions, but just plain ones (that are most porbably
> mapped to xxx64 friends anyway :-)

Indeed - this is the way it works on IRIX. When compiling in 64
bit mode, the relevent abstract types just get mapped to their
64 bit equivalents. That's why Samba now uses the correct abstract
types and only checks their actual size when it has to linearize
them to/from an SMB packet.

> God, people, ther _is_ standard way to do things. It may be possible, that
> this or other system is broken - then we must find fix or workaround for it.
> We must decide, what type of interface (transitional or explicit) to use in
> SAMBA. To use transitional interface, the application needs to define
> _LARGEFILE64_SOURCE and set CFLAGS to output of getconf LFS64_CFLAGS. To use
> explicit interface, applicaition needs to set _LARGEFILE_SOURCE and CFLAGS
> to output of getconf LFS_CFLAGS. This way it should work on any LFS
> conformant system. If this does not work - the system is broken. But Sun was
> member of LFS, and I don't see any reason, why it won't work there.

Well the current Samba 2.0 code is written so it has
the capability of using either the explicit, or
full 64 bit interfaces.

That's why the code in lib/system.c checks for open64
and friends and will use them if present (ie. explicit
interface). If open64 and friends are not defined then
it's either a 32 bit system, or a 64 bit system
using the correct mapping for off_t and friends. In
this case Samba checks for the actual size in bits
of off_t and other things that need linearizing and
does the correct thing when putting them on the wire.

Dave's comment :

>         Samba explicitly calls statvfs64() function, and
>         the sun implementation triggered by 
>         only makes statvfs() visible, using the 64-bit
>         sizes of the various variables.

Is actually incorrect. Samba *looks* for statvfs64
and will use it if found. If not it will happily
use statvfs with 64 bit variable sizes.

I think I see the problem - Dave, how do you tell
the C compiler in Solaris 2.6/2.7 to use the full
64 bit wide interfaces (ie. no open64/statvfs64 etc.)
but just have off_t and friends be 64 bits wide ?

Samba is coded to handle this case, as it's how
it is done on IRIX. The only issue is that when
the C compiler flags are set to use the 64 bit wide
interfaces (ie. no open64 etc.) then the explicit
interfaces (open64 etc.) should *not* be found by autoconf.

Does this help ?


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list