backported SIZE_MAX as SZ_MAX