Call VIRTUAL_HandleFault if read/write returns EFAULT.

This commit is contained in:
Ulrich Weigand 1999-02-09 15:29:27 +00:00 committed by Alexandre Julliard
parent 4bd7128f09
commit b7b205046f

View File

@ -1147,6 +1147,7 @@ BOOL32 WINAPI ReadFile( HANDLE32 hFile, LPVOID buffer, DWORD bytesToRead,
while ((result = read( unix_handle, buffer, bytesToRead )) == -1) while ((result = read( unix_handle, buffer, bytesToRead )) == -1)
{ {
if ((errno == EAGAIN) || (errno == EINTR)) continue; if ((errno == EAGAIN) || (errno == EINTR)) continue;
if ((errno == EFAULT) && VIRTUAL_HandleFault( buffer )) continue;
FILE_SetDosError(); FILE_SetDosError();
break; break;
} }
@ -1180,6 +1181,7 @@ BOOL32 WINAPI WriteFile( HANDLE32 hFile, LPCVOID buffer, DWORD bytesToWrite,
while ((result = write( unix_handle, buffer, bytesToWrite )) == -1) while ((result = write( unix_handle, buffer, bytesToWrite )) == -1)
{ {
if ((errno == EAGAIN) || (errno == EINTR)) continue; if ((errno == EAGAIN) || (errno == EINTR)) continue;
if ((errno == EFAULT) && VIRTUAL_HandleFault( buffer )) continue;
FILE_SetDosError(); FILE_SetDosError();
break; break;
} }