64 bit support

Andrew Tridgell tridge at linuxcare.com
Tue Sep 26 06:12:56 GMT 2000

I've been playing with 64 bit support on Linux i386.  As usual the
problems are primarily with locking, the glibc headers and code are
really bad, making it just about impossible to make 64 bit off_t work.

Anyway, I have got it to work with some gross hacks involving
bypassing the C library for fcntl() and I'll be putting that in as a
compile time option for those people who really need 64 bit support in
Samba on Intel Linux.

Meanwhile, I propose that we drop the explicit calls to open64() and
friends in Samba and instead use the LFS way of doing things where
compiler flags are used to select a 64 bit interface by default. This
seems to be widely supported now and makes the application code much

Jeremy, you've dealt with this issue before, what do you think of
removing the explicit 64 bit calls and instead use something like the
AC_SYS_LARGEFILE autoconf macro (or something equivalent) to set the
right compiler flags to get a 64 bit default interface. 

We would need some more extensive autoconf tests of the 64 bit
interface (particularly with locking) but the advantage would be
simpler and more maintainable code.

oh btw, if you use the 64 bit off_t flags with the C library from
RedHat 7.0 (glibc 2.1.95) and a 2.4.0test kernel then you get full
support for 64 bit files except the locking is _completely_ broken.
The effect is that the l_len parameter in struct flock gets seen by
the kernel as 0 for all locks (it gets interpreted as a struct flock
whereas glibc is giving it a struct flock64), which means all
locks/unlocks apply from lock start to EOF. This completely breaks tdb
and can easily cause data corruption with Samba. This is going to make
for some interesting bug reports in some packages I expect.

Cheers, Tridge

More information about the samba-technical mailing list