mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-26 23:34:18 +02:00
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:
parent
767cafa737
commit
7fd6a6b71b
@ -1249,8 +1249,14 @@ long rwblock(COUNT fd, VOID FAR * buffer, UCOUNT count, int mode)
|
|||||||
{
|
{
|
||||||
if (mode == XFR_WRITE)
|
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 */
|
/* can't extend beyond 4G so return '0 byte written, DISK_FULL */
|
||||||
return DE_HNDLDSKFULL;
|
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 */
|
/* else XFR_READ should end automatically at EOF */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user