Again, reminder that size_t is also 32 bit on 32-bit architectures, because size_t is used for the size of in-memory objects.
Anything that is on disk can have a size that only fits into an off_t, which is 64 bit if large file support is enabled, and 32 bit if it is not. If large file support is disabled, opening a file larger than 2 GB is supposed to fail (because you need to pass O_LARGEFILE, which is defined only if large file support is enabled), but there is a chance that an on-disk object got truncated, so that is not guaranteed.
So, use size_t only for in-memory data, but if you are reading data from disk piecewise, the total count of data processed needs to be an off_t.
Simon