09.04.2022 02:46, Michael Tokarev wrote:
And no, samba team does not "request" all architectures to
declare -DFILE_OFFSET_BITS.  It is the setting with which
samba is built (in order to support files >2Gb in size), -
including libsmbclient too. So all functions in there which
deal with file sizes and offsets - the one using off_t
datatype - even on 32bit platforms like i386, use 64-bit
value there. This is called LFS (Large File Support). When
you compile your program without this #define on a 32bit
system, you'll be getting off_t size = 4 bytes (32bits),
but actual functions in actual libsmbclient are using
prototypes with 64-bit off_t. So you'll be having
weird runtime errors with everything seemingly correct.

I forgot to mention. The value for -DFILE_OFFSET_BITS &Co
to use for a given system is obtained from the following
command:

 getconf LFS_CFLAGS

or as variable assignment:

 CFLAGS=$(getconf LFS_CFLAGS)

/mjt

Reply via email to