diff options
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 00e987587..ae5edcb62 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -31,6 +31,7 @@ details. */ #include <winioctl.h> #include <ntdef.h> #include "ntdll.h" +#include "mmap_helper.h" static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */ @@ -223,10 +224,8 @@ fhandler_base::raw_read (void *ptr, size_t& ulen) HANDLE h = NULL; /* grumble */ int prio = 0; /* ditto */ - int try_noreserve = 1; DWORD len = ulen; -retry: ulen = (size_t) -1; if (read_state) { @@ -235,7 +234,7 @@ retry: SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL); signal_read_state (1); } - BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0); + BOOL res = mmReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0); if (read_state) { signal_read_state (1); @@ -261,19 +260,6 @@ retry: bytes_read = 0; break; } - if (try_noreserve) - { - try_noreserve = 0; - switch (mmap_is_attached_or_noreserve (ptr, len)) - { - case MMAP_NORESERVE_COMMITED: - goto retry; - case MMAP_RAISE_SIGBUS: - raise(SIGBUS); - case MMAP_NONE: - break; - } - } /*FALLTHRU*/ case ERROR_INVALID_FUNCTION: case ERROR_INVALID_PARAMETER: |