Make sure to widen secsz from size_t to off_t when using it as a mask.
On 32-bit machines this would other wise mask off the upper 32-bits
of the 64-bit file offset.
Make sure the cookies are constants of appropriate width.