add alternative path (compile time determined) if attempt to write >4GB should fail whole write or succeed but only up to 4GB (based on email from Tom)

This commit is contained in:
Kenneth J Davis 2025-03-28 17:04:59 -04:00
parent 767cafa737
commit 7fd6a6b71b
No known key found for this signature in database
GPG Key ID: 59D5F216C38F11FD

View File

@ -1249,8 +1249,14 @@ long rwblock(COUNT fd, VOID FAR * buffer, UCOUNT count, int mode)
{
if (mode == XFR_WRITE)
{
#if 1 /* we fail write call even if could partially succeed */
/* can't extend beyond 4G so return '0 byte written, DISK_FULL */
return DE_HNDLDSKFULL;
#else
/* truncate request to max size can write */
ULONG max_count = (ULONG)-1 - fnp->f_offset;
count = (max_count >= (UCOUNT)-1)?(UCOUNT)-1:(UCOUNT)max_count;
#endif
}
/* else XFR_READ should end automatically at EOF */
}